@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.
- package/README.md +29 -27
- package/bin/mcp-server.js +81 -38
- package/bin/mcp-server.js.map +12 -12
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/config.js.map +1 -1
- package/esm/lib/encodings.d.ts.map +1 -1
- package/esm/lib/encodings.js +3 -1
- package/esm/lib/encodings.js.map +1 -1
- package/esm/lib/matchers.d.ts.map +1 -1
- package/esm/lib/matchers.js +2 -1
- package/esm/lib/matchers.js.map +1 -1
- package/esm/mcp-server/mcp-server.js +1 -1
- package/esm/mcp-server/server.js +1 -1
- package/esm/mcp-server/tools/shipmentsList.d.ts.map +1 -1
- package/esm/mcp-server/tools/shipmentsList.js +28 -17
- package/esm/mcp-server/tools/shipmentsList.js.map +1 -1
- package/esm/mcp-server/tools/transactionsList.d.ts.map +1 -1
- package/esm/mcp-server/tools/transactionsList.js +34 -3
- package/esm/mcp-server/tools/transactionsList.js.map +1 -1
- package/esm/models/batchshipment.d.ts +3 -3
- package/esm/models/batchshipment.d.ts.map +1 -1
- package/esm/models/batchshipment.js +3 -3
- package/esm/models/batchshipment.js.map +1 -1
- package/esm/models/batchshipmentcreaterequest.d.ts +2 -2
- package/esm/models/batchshipmentcreaterequest.d.ts.map +1 -1
- package/esm/models/batchshipmentcreaterequest.js +2 -2
- package/esm/models/batchshipmentcreaterequest.js.map +1 -1
- package/esm/models/rate.d.ts +1 -1
- package/esm/models/rate.d.ts.map +1 -1
- package/esm/models/rate.js +1 -1
- package/esm/models/rate.js.map +1 -1
- package/manifest.json +5 -6
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +4 -3
- package/src/lib/matchers.ts +3 -1
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/shipmentsList.ts +33 -21
- package/src/mcp-server/tools/transactionsList.ts +35 -3
- package/src/models/batchshipment.ts +6 -6
- package/src/models/batchshipmentcreaterequest.ts +4 -4
- package/src/models/rate.ts +2 -2
- package/tsconfig.json +0 -1
package/src/mcp-server/server.ts
CHANGED
|
@@ -12,32 +12,44 @@ const args = {
|
|
|
12
12
|
|
|
13
13
|
export const tool$shipmentsList: ToolDefinition<typeof args> = {
|
|
14
14
|
name: "shipments-list",
|
|
15
|
-
description:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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":
|
|
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:
|
|
15
|
+
description:
|
|
16
|
+
`**LIST TRANSACTIONS (Purchased Labels)** - Use this for finding shipped/delivered packages!
|
|
16
17
|
|
|
17
|
-
|
|
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":
|
|
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
|
});
|
package/src/models/rate.ts
CHANGED
|
@@ -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 }),
|