@shippo/shippo-mcp 0.8.0 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +29 -27
  2. package/bin/mcp-server.js +81 -38
  3. package/bin/mcp-server.js.map +12 -12
  4. package/esm/lib/config.d.ts +3 -3
  5. package/esm/lib/config.js +3 -3
  6. package/esm/lib/config.js.map +1 -1
  7. package/esm/lib/encodings.d.ts.map +1 -1
  8. package/esm/lib/encodings.js +3 -1
  9. package/esm/lib/encodings.js.map +1 -1
  10. package/esm/lib/matchers.d.ts.map +1 -1
  11. package/esm/lib/matchers.js +2 -1
  12. package/esm/lib/matchers.js.map +1 -1
  13. package/esm/mcp-server/mcp-server.js +1 -1
  14. package/esm/mcp-server/server.js +1 -1
  15. package/esm/mcp-server/tools/shipmentsList.d.ts.map +1 -1
  16. package/esm/mcp-server/tools/shipmentsList.js +28 -17
  17. package/esm/mcp-server/tools/shipmentsList.js.map +1 -1
  18. package/esm/mcp-server/tools/transactionsList.d.ts.map +1 -1
  19. package/esm/mcp-server/tools/transactionsList.js +34 -3
  20. package/esm/mcp-server/tools/transactionsList.js.map +1 -1
  21. package/esm/models/batchshipment.d.ts +3 -3
  22. package/esm/models/batchshipment.d.ts.map +1 -1
  23. package/esm/models/batchshipment.js +3 -3
  24. package/esm/models/batchshipment.js.map +1 -1
  25. package/esm/models/batchshipmentcreaterequest.d.ts +2 -2
  26. package/esm/models/batchshipmentcreaterequest.d.ts.map +1 -1
  27. package/esm/models/batchshipmentcreaterequest.js +2 -2
  28. package/esm/models/batchshipmentcreaterequest.js.map +1 -1
  29. package/esm/models/rate.d.ts +1 -1
  30. package/esm/models/rate.d.ts.map +1 -1
  31. package/esm/models/rate.js +1 -1
  32. package/esm/models/rate.js.map +1 -1
  33. package/manifest.json +5 -6
  34. package/package.json +1 -1
  35. package/src/lib/config.ts +3 -3
  36. package/src/lib/encodings.ts +4 -3
  37. package/src/lib/matchers.ts +3 -1
  38. package/src/mcp-server/mcp-server.ts +1 -1
  39. package/src/mcp-server/server.ts +1 -1
  40. package/src/mcp-server/tools/shipmentsList.ts +33 -21
  41. package/src/mcp-server/tools/transactionsList.ts +35 -3
  42. package/src/models/batchshipment.ts +6 -6
  43. package/src/models/batchshipmentcreaterequest.ts +4 -4
  44. package/src/models/rate.ts +2 -2
  45. package/tsconfig.json +0 -1
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "0.1.9",
22
+ currentVersion: "0.8.3",
23
23
  },
24
24
  });
25
25
 
@@ -96,7 +96,7 @@ export function createMCPServer(deps: {
96
96
  }) {
97
97
  const server = new McpServer({
98
98
  name: "ShippoSDK",
99
- version: "0.1.9",
99
+ version: "0.8.3",
100
100
  });
101
101
 
102
102
  const getClient = deps.getSDK || (() =>
@@ -12,32 +12,44 @@ const args = {
12
12
 
13
13
  export const tool$shipmentsList: ToolDefinition<typeof args> = {
14
14
  name: "shipments-list",
15
- description: `List all shipments
16
-
17
- Returns a list of all shipment objects.<br><br>
18
- In order to filter results, you must use the below path parameters.
19
- A maximum date range of 90 days is permitted.
20
- Provided dates should be ISO 8601 UTC dates (timezone offsets are currently not supported).<br><br>
21
-
22
- Optional path parameters:<br>
23
- \`object_created_gt\`- object(s) created greater than a provided date time<br>
24
- \`object_created_gte\` - object(s) created greater than or equal to a provided date time<br>
25
- \`object_created_lt\` - object(s) created less than a provided date time<br>
26
- \`object_created_lte\` - object(s) created less than or equal to a provided date time<br>
27
-
28
- Date format examples:<br>
29
- \`2017-01-01\`<br>
30
- \`2017-01-01T03:30:30\` or \`2017-01-01T03:30:30.5\`<br>
31
- \`2017-01-01T03:30:30Z\`<br><br>
32
-
33
- Example URL:<br>
34
- \`https://api.goshippo.com/shipments/?object_created_gte=2017-01-01T00:00:30&object_created_lt=2017-04-01T00:00:30\``,
15
+ description:
16
+ `**LIST SHIPMENTS (Rate Quotes)** - NOT for finding delivered packages!
17
+
18
+ This tool lists shipment objects, which represent rate shopping sessions. Each shipment contains:
19
+ - Sender/recipient addresses
20
+ - Parcel dimensions
21
+ - Available shipping rates from carriers
22
+
23
+ **IMPORTANT DISTINCTIONS:**
24
+ - Shipments = Rate quotes/shopping sessions
25
+ - Shipments do NOT have tracking or delivery status
26
+ - Use \`transactions-list\` to find purchased labels with tracking status
27
+
28
+ **When to use this tool:**
29
+ - List recent rate shopping sessions
30
+ - Find a shipment to view its rates
31
+ - Review shipment details before purchasing a label
32
+
33
+ **When NOT to use this tool:**
34
+ - ❌ Finding "delivered" shipments (use transactions-list instead)
35
+ - ❌ Getting tracking information (use tracking-status-get)
36
+ - ❌ Finding purchased labels (use transactions-list)
37
+
38
+ **Available Filters:**
39
+ - \`object_created_gt/gte/lt/lte\`: Filter by creation date
40
+ - \`page/results\`: Pagination
41
+
42
+ **Example Use Case:**
43
+ "Show me shipments I created this week" → Use this tool
44
+ "Show me delivered packages" → Use transactions-list with tracking_status filter
45
+ `,
46
+ scopes: ["read"],
35
47
  annotations: {
36
48
  "title": "",
37
49
  "destructiveHint": false,
38
50
  "idempotentHint": false,
39
51
  "openWorldHint": false,
40
- "readOnlyHint": true,
52
+ "readOnlyHint": false,
41
53
  },
42
54
  args,
43
55
  tool: async (client, args, ctx) => {
@@ -12,15 +12,47 @@ const args = {
12
12
 
13
13
  export const tool$transactionsList: ToolDefinition<typeof args> = {
14
14
  name: "transactions-list",
15
- description: `List all shipping labels
15
+ description:
16
+ `**LIST TRANSACTIONS (Purchased Labels)** - Use this for finding shipped/delivered packages!
16
17
 
17
- Returns a list of all transaction objects.`,
18
+ This tool lists transaction objects, which represent purchased shipping labels. Each transaction contains:
19
+ - Tracking number and tracking URL
20
+ - Label URL for printing
21
+ - Tracking status (UNKNOWN, PRE_TRANSIT, TRANSIT, DELIVERED, RETURNED, FAILURE)
22
+ - Purchase date and carrier info
23
+
24
+ **IMPORTANT DISTINCTIONS:**
25
+ - Transactions = Purchased shipping labels
26
+ - Transactions HAVE tracking status and tracking numbers
27
+ - Use \`shipments-list\` for rate quotes (unpurchased shipments)
28
+
29
+ **When to use this tool:**
30
+ - Find delivered packages → filter by \`tracking_status: "DELIVERED"\`
31
+ - Find packages in transit → filter by \`tracking_status: "TRANSIT"\`
32
+ - List all purchased labels
33
+ - Find a specific label by rate ID
34
+
35
+ **Available Filters:**
36
+ - \`tracking_status\`: UNKNOWN, PRE_TRANSIT, TRANSIT, DELIVERED, RETURNED, FAILURE
37
+ - \`object_status\`: WAITING, QUEUED, SUCCESS, ERROR, REFUNDED, REFUNDPENDING, REFUNDREJECTED
38
+ - \`rate\`: Filter by rate ID
39
+ - \`page/results\`: Pagination
40
+
41
+ **Example Use Cases:**
42
+ - "Show delivered shipments" → \`{tracking_status: "DELIVERED"}\`
43
+ - "Show packages in transit" → \`{tracking_status: "TRANSIT"}\`
44
+ - "Show all labels" → \`{results: 25}\`
45
+
46
+ **Note on Test Mode:**
47
+ Test transactions will always show \`tracking_status: "UNKNOWN"\` because they don't receive real carrier tracking updates.
48
+ `,
49
+ scopes: ["read"],
18
50
  annotations: {
19
51
  "title": "",
20
52
  "destructiveHint": false,
21
53
  "idempotentHint": false,
22
54
  "openWorldHint": false,
23
- "readOnlyHint": true,
55
+ "readOnlyHint": false,
24
56
  },
25
57
  args,
26
58
  tool: async (client, args, ctx) => {
@@ -27,14 +27,14 @@ export const BatchShipmentStatus$zodSchema = z.enum([
27
27
  export type BatchShipmentStatus = z.infer<typeof BatchShipmentStatus$zodSchema>;
28
28
 
29
29
  export type BatchShipment = {
30
- carrier_account?: string | undefined;
30
+ carrier_account?: string | null | undefined;
31
31
  metadata?: string | undefined;
32
- servicelevel_token?: string | undefined;
32
+ servicelevel_token?: string | null | undefined;
33
33
  messages?: Array<any> | undefined;
34
34
  object_id: string;
35
35
  shipment: string;
36
36
  status: BatchShipmentStatus;
37
- transaction?: string | undefined;
37
+ transaction?: string | null | undefined;
38
38
  };
39
39
 
40
40
  export const BatchShipment$zodSchema: z.ZodType<
@@ -42,12 +42,12 @@ export const BatchShipment$zodSchema: z.ZodType<
42
42
  z.ZodTypeDef,
43
43
  unknown
44
44
  > = z.object({
45
- carrier_account: z.string().optional(),
45
+ carrier_account: z.string().nullable().optional(),
46
46
  messages: z.array(z.any()).optional(),
47
47
  metadata: z.string().optional(),
48
48
  object_id: z.string(),
49
- servicelevel_token: z.string().optional(),
49
+ servicelevel_token: z.string().nullable().optional(),
50
50
  shipment: z.string(),
51
51
  status: BatchShipmentStatus$zodSchema,
52
- transaction: z.string().optional(),
52
+ transaction: z.string().nullable().optional(),
53
53
  });
@@ -9,9 +9,9 @@ import {
9
9
  } from "./shipmentcreaterequest.js";
10
10
 
11
11
  export type BatchShipmentCreateRequest = {
12
- carrier_account?: string | undefined;
12
+ carrier_account?: string | null | undefined;
13
13
  metadata?: string | undefined;
14
- servicelevel_token?: string | undefined;
14
+ servicelevel_token?: string | null | undefined;
15
15
  shipment: ShipmentCreateRequest;
16
16
  };
17
17
 
@@ -20,8 +20,8 @@ export const BatchShipmentCreateRequest$zodSchema: z.ZodType<
20
20
  z.ZodTypeDef,
21
21
  unknown
22
22
  > = z.object({
23
- carrier_account: z.string().optional(),
23
+ carrier_account: z.string().nullable().optional(),
24
24
  metadata: z.string().optional(),
25
- servicelevel_token: z.string().optional(),
25
+ servicelevel_token: z.string().nullable().optional(),
26
26
  shipment: ShipmentCreateRequest$zodSchema,
27
27
  });
@@ -29,7 +29,7 @@ export type Rate = {
29
29
  attributes: Array<Attribute>;
30
30
  carrier_account: string;
31
31
  duration_terms?: string | undefined;
32
- estimated_days?: number | undefined;
32
+ estimated_days?: number | null | undefined;
33
33
  included_insurance_price?: string | null | undefined;
34
34
  messages?: Array<ResponseMessage> | undefined;
35
35
  object_created: string;
@@ -53,7 +53,7 @@ export const Rate$zodSchema: z.ZodType<Rate, z.ZodTypeDef, unknown> = z.object({
53
53
  currency: z.string(),
54
54
  currency_local: z.string(),
55
55
  duration_terms: z.string().optional(),
56
- estimated_days: z.number().int().optional(),
56
+ estimated_days: z.number().int().nullable().optional(),
57
57
  included_insurance_price: z.string().nullable().optional(),
58
58
  messages: z.array(ResponseMessage$zodSchema).optional(),
59
59
  object_created: z.string().datetime({ offset: true }),
package/tsconfig.json CHANGED
@@ -28,7 +28,6 @@
28
28
  "sourceMap": true,
29
29
  "strict": true,
30
30
  "target": "es2022",
31
- "tsBuildInfoFile": ".tsbuildinfo",
32
31
  "useUnknownInCatchVariables": true,
33
32
  },
34
33
  "exclude": ["node_modules"],