@henrylabs/mcp 0.15.0 → 0.18.0
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 +13 -334
- package/code-tool.d.mts +2 -44
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts +2 -44
- package/code-tool.d.ts.map +1 -1
- package/code-tool.js +7 -3
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +7 -3
- package/code-tool.mjs.map +1 -1
- package/docs-search-tool.d.mts +3 -3
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts +3 -3
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.js +1 -1
- package/docs-search-tool.js.map +1 -1
- package/docs-search-tool.mjs +1 -1
- package/http.d.mts.map +1 -1
- package/http.d.ts.map +1 -1
- package/http.js +1 -18
- package/http.js.map +1 -1
- package/http.mjs +1 -18
- package/http.mjs.map +1 -1
- package/index.js +4 -40
- package/index.js.map +1 -1
- package/index.mjs +4 -40
- package/index.mjs.map +1 -1
- package/options.d.mts +0 -9
- package/options.d.mts.map +1 -1
- package/options.d.ts +0 -9
- package/options.d.ts.map +1 -1
- package/options.js +4 -359
- package/options.js.map +1 -1
- package/options.mjs +4 -359
- package/options.mjs.map +1 -1
- package/package.json +9 -49
- package/server.d.mts +3 -8
- package/server.d.mts.map +1 -1
- package/server.d.ts +3 -8
- package/server.d.ts.map +1 -1
- package/server.js +12 -65
- package/server.js.map +1 -1
- package/server.mjs +11 -62
- package/server.mjs.map +1 -1
- package/src/code-tool.ts +7 -3
- package/src/docs-search-tool.ts +1 -1
- package/src/http.ts +1 -19
- package/src/index.ts +5 -52
- package/src/options.ts +5 -386
- package/src/server.ts +12 -72
- package/src/stdio.ts +2 -3
- package/src/{tools/types.ts → types.ts} +1 -1
- package/stdio.d.mts +1 -2
- package/stdio.d.mts.map +1 -1
- package/stdio.d.ts +1 -2
- package/stdio.d.ts.map +1 -1
- package/stdio.js +2 -2
- package/stdio.js.map +1 -1
- package/stdio.mjs +2 -2
- package/stdio.mjs.map +1 -1
- package/{tools/types.d.mts → types.d.mts} +1 -1
- package/types.d.mts.map +1 -0
- package/{tools/types.d.ts → types.d.ts} +1 -1
- package/types.d.ts.map +1 -0
- package/types.js.map +1 -0
- package/types.mjs.map +1 -0
- package/compat.d.mts +0 -58
- package/compat.d.mts.map +0 -1
- package/compat.d.ts +0 -58
- package/compat.d.ts.map +0 -1
- package/compat.js +0 -387
- package/compat.js.map +0 -1
- package/compat.mjs +0 -378
- package/compat.mjs.map +0 -1
- package/dynamic-tools.d.mts +0 -12
- package/dynamic-tools.d.mts.map +0 -1
- package/dynamic-tools.d.ts +0 -12
- package/dynamic-tools.d.ts.map +0 -1
- package/dynamic-tools.js +0 -135
- package/dynamic-tools.js.map +0 -1
- package/dynamic-tools.mjs +0 -132
- package/dynamic-tools.mjs.map +0 -1
- package/filtering.d.mts +0 -3
- package/filtering.d.mts.map +0 -1
- package/filtering.d.ts +0 -3
- package/filtering.d.ts.map +0 -1
- package/filtering.js +0 -24
- package/filtering.js.map +0 -1
- package/filtering.mjs +0 -16
- package/filtering.mjs.map +0 -1
- package/src/compat.ts +0 -483
- package/src/dynamic-tools.ts +0 -153
- package/src/filtering.ts +0 -18
- package/src/tools/cart/create-cart-checkout.ts +0 -60
- package/src/tools/cart/items/add-cart-items.ts +0 -100
- package/src/tools/cart/items/clear-cart-items.ts +0 -54
- package/src/tools/cart/items/list-cart-items.ts +0 -54
- package/src/tools/cart/items/remove-cart-items.ts +0 -57
- package/src/tools/index.ts +0 -87
- package/src/tools/orders/retrieve-status-orders.ts +0 -54
- package/src/tools/products/retrieve-product-details.ts +0 -48
- package/src/tools/products/search-products.ts +0 -110
- package/src/tools/wallet/collect-payment-details.ts +0 -56
- package/src/tools.ts +0 -1
- package/tools/cart/create-cart-checkout.d.mts +0 -51
- package/tools/cart/create-cart-checkout.d.mts.map +0 -1
- package/tools/cart/create-cart-checkout.d.ts +0 -51
- package/tools/cart/create-cart-checkout.d.ts.map +0 -1
- package/tools/cart/create-cart-checkout.js +0 -60
- package/tools/cart/create-cart-checkout.js.map +0 -1
- package/tools/cart/create-cart-checkout.mjs +0 -53
- package/tools/cart/create-cart-checkout.mjs.map +0 -1
- package/tools/cart/items/add-cart-items.d.mts +0 -51
- package/tools/cart/items/add-cart-items.d.mts.map +0 -1
- package/tools/cart/items/add-cart-items.d.ts +0 -51
- package/tools/cart/items/add-cart-items.d.ts.map +0 -1
- package/tools/cart/items/add-cart-items.js +0 -98
- package/tools/cart/items/add-cart-items.js.map +0 -1
- package/tools/cart/items/add-cart-items.mjs +0 -91
- package/tools/cart/items/add-cart-items.mjs.map +0 -1
- package/tools/cart/items/clear-cart-items.d.mts +0 -51
- package/tools/cart/items/clear-cart-items.d.mts.map +0 -1
- package/tools/cart/items/clear-cart-items.d.ts +0 -51
- package/tools/cart/items/clear-cart-items.d.ts.map +0 -1
- package/tools/cart/items/clear-cart-items.js +0 -54
- package/tools/cart/items/clear-cart-items.js.map +0 -1
- package/tools/cart/items/clear-cart-items.mjs +0 -47
- package/tools/cart/items/clear-cart-items.mjs.map +0 -1
- package/tools/cart/items/list-cart-items.d.mts +0 -51
- package/tools/cart/items/list-cart-items.d.mts.map +0 -1
- package/tools/cart/items/list-cart-items.d.ts +0 -51
- package/tools/cart/items/list-cart-items.d.ts.map +0 -1
- package/tools/cart/items/list-cart-items.js +0 -54
- package/tools/cart/items/list-cart-items.js.map +0 -1
- package/tools/cart/items/list-cart-items.mjs +0 -47
- package/tools/cart/items/list-cart-items.mjs.map +0 -1
- package/tools/cart/items/remove-cart-items.d.mts +0 -51
- package/tools/cart/items/remove-cart-items.d.mts.map +0 -1
- package/tools/cart/items/remove-cart-items.d.ts +0 -51
- package/tools/cart/items/remove-cart-items.d.ts.map +0 -1
- package/tools/cart/items/remove-cart-items.js +0 -57
- package/tools/cart/items/remove-cart-items.js.map +0 -1
- package/tools/cart/items/remove-cart-items.mjs +0 -50
- package/tools/cart/items/remove-cart-items.mjs.map +0 -1
- package/tools/index.d.mts +0 -10
- package/tools/index.d.mts.map +0 -1
- package/tools/index.d.ts +0 -10
- package/tools/index.d.ts.map +0 -1
- package/tools/index.js +0 -71
- package/tools/index.js.map +0 -1
- package/tools/index.mjs +0 -64
- package/tools/index.mjs.map +0 -1
- package/tools/orders/retrieve-status-orders.d.mts +0 -51
- package/tools/orders/retrieve-status-orders.d.mts.map +0 -1
- package/tools/orders/retrieve-status-orders.d.ts +0 -51
- package/tools/orders/retrieve-status-orders.d.ts.map +0 -1
- package/tools/orders/retrieve-status-orders.js +0 -54
- package/tools/orders/retrieve-status-orders.js.map +0 -1
- package/tools/orders/retrieve-status-orders.mjs +0 -47
- package/tools/orders/retrieve-status-orders.mjs.map +0 -1
- package/tools/products/retrieve-product-details.d.mts +0 -51
- package/tools/products/retrieve-product-details.d.mts.map +0 -1
- package/tools/products/retrieve-product-details.d.ts +0 -51
- package/tools/products/retrieve-product-details.d.ts.map +0 -1
- package/tools/products/retrieve-product-details.js +0 -49
- package/tools/products/retrieve-product-details.js.map +0 -1
- package/tools/products/retrieve-product-details.mjs +0 -42
- package/tools/products/retrieve-product-details.mjs.map +0 -1
- package/tools/products/search-products.d.mts +0 -51
- package/tools/products/search-products.d.mts.map +0 -1
- package/tools/products/search-products.d.ts +0 -51
- package/tools/products/search-products.d.ts.map +0 -1
- package/tools/products/search-products.js +0 -110
- package/tools/products/search-products.js.map +0 -1
- package/tools/products/search-products.mjs +0 -103
- package/tools/products/search-products.mjs.map +0 -1
- package/tools/types.d.mts.map +0 -1
- package/tools/types.d.ts.map +0 -1
- package/tools/types.js.map +0 -1
- package/tools/types.mjs.map +0 -1
- package/tools/wallet/collect-payment-details.d.mts +0 -51
- package/tools/wallet/collect-payment-details.d.mts.map +0 -1
- package/tools/wallet/collect-payment-details.d.ts +0 -51
- package/tools/wallet/collect-payment-details.d.ts.map +0 -1
- package/tools/wallet/collect-payment-details.js +0 -56
- package/tools/wallet/collect-payment-details.js.map +0 -1
- package/tools/wallet/collect-payment-details.mjs +0 -49
- package/tools/wallet/collect-payment-details.mjs.map +0 -1
- package/tools.d.mts +0 -2
- package/tools.d.mts.map +0 -1
- package/tools.d.ts +0 -2
- package/tools.d.ts.map +0 -1
- package/tools.js +0 -18
- package/tools.js.map +0 -1
- package/tools.mjs +0 -2
- package/tools.mjs.map +0 -1
- /package/{tools/types.js → types.js} +0 -0
- /package/{tools/types.mjs → types.mjs} +0 -0
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.handler = exports.tool = exports.metadata = void 0;
|
|
8
|
-
const filtering_1 = require("@henrylabs/mcp/filtering");
|
|
9
|
-
const types_1 = require("@henrylabs/mcp/tools/types");
|
|
10
|
-
const sdk_1 = __importDefault(require("@henrylabs/sdk"));
|
|
11
|
-
exports.metadata = {
|
|
12
|
-
resource: 'cart.items',
|
|
13
|
-
operation: 'write',
|
|
14
|
-
tags: [],
|
|
15
|
-
httpMethod: 'post',
|
|
16
|
-
httpPath: '/cart/items',
|
|
17
|
-
operationId: 'addCartItems',
|
|
18
|
-
};
|
|
19
|
-
exports.tool = {
|
|
20
|
-
name: 'add_cart_items',
|
|
21
|
-
description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nAdd products to cart or update quantities if already in cart.\n\nRequired fields per product:\n- name: Product name (from retrieve_product_details)\n- price: Price as string, e.g. \"29.99\" (from stores[0].price)\n- productLink: Store URL (from stores[0].link - MUST call retrieve_product_details first)\n- quantity: Number of items\n\nOptional but IMPORTANT:\n- metadata: Object containing variant selections (size, color, etc.)\n Example: {\"size\": \"Large\", \"color\": \"Blue\"}\n- productImageLink: Thumbnail URL (from thumbnails[0])\n- affiliateProductLink: Use instead of productLink for affiliate tracking\n- productId: Include for easier tracking\n\nVARIANT HANDLING:\nIf retrieve_product_details shows variants array, you MUST:\n1. Show variants to user: \"Available sizes: S, M, L, XL\"\n2. Get user's selection\n3. Include in metadata: {\"size\": \"L\"}\n\nOptional: Set checkVariantAvailability: true to verify variants exist at stores\n\nReturns:\n- added_products: New items in cart\n- updated_products: Items with quantity increases\n- cart_summary: total_items and total_unique_products\n- variant_checks: Availability verification results (if requested)\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/item_add_response',\n $defs: {\n item_add_response: {\n type: 'object',\n properties: {\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n },\n data: {\n type: 'object',\n properties: {\n added_products: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: {\n type: 'string'\n },\n price: {\n type: 'string'\n },\n productId: {\n type: 'string'\n },\n quantity: {\n type: 'number'\n }\n },\n required: [ 'name',\n 'price',\n 'productId',\n 'quantity'\n ]\n }\n },\n cart_summary: {\n type: 'object',\n properties: {\n total_items: {\n type: 'number'\n },\n total_unique_products: {\n type: 'number'\n }\n },\n required: [ 'total_items',\n 'total_unique_products'\n ]\n },\n updated_products: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n addedQuantity: {\n type: 'number'\n },\n name: {\n type: 'string'\n },\n previousQuantity: {\n type: 'number'\n },\n price: {\n type: 'string'\n },\n productId: {\n type: 'string'\n },\n quantity: {\n type: 'number'\n }\n },\n required: [ 'addedQuantity',\n 'name',\n 'previousQuantity',\n 'price',\n 'productId',\n 'quantity'\n ]\n }\n },\n variant_checks: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n productId: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n variantCheckRequestId: {\n type: 'string'\n }\n },\n required: [ 'productId',\n 'status',\n 'variantCheckRequestId'\n ]\n }\n }\n },\n required: [ 'added_products',\n 'cart_summary',\n 'updated_products'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
|
-
inputSchema: {
|
|
23
|
-
type: 'object',
|
|
24
|
-
properties: {
|
|
25
|
-
productsDetails: {
|
|
26
|
-
type: 'array',
|
|
27
|
-
items: {
|
|
28
|
-
type: 'object',
|
|
29
|
-
properties: {
|
|
30
|
-
name: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
description: 'Product name',
|
|
33
|
-
},
|
|
34
|
-
price: {
|
|
35
|
-
type: 'string',
|
|
36
|
-
description: 'Product price',
|
|
37
|
-
},
|
|
38
|
-
productLink: {
|
|
39
|
-
type: 'string',
|
|
40
|
-
description: 'Product link',
|
|
41
|
-
},
|
|
42
|
-
quantity: {
|
|
43
|
-
type: 'number',
|
|
44
|
-
description: 'Quantity',
|
|
45
|
-
},
|
|
46
|
-
affiliateProductLink: {
|
|
47
|
-
type: 'string',
|
|
48
|
-
description: 'Affiliate product link (if provided, will be used instead of productLink for order fulfillment)',
|
|
49
|
-
},
|
|
50
|
-
metadata: {
|
|
51
|
-
type: 'object',
|
|
52
|
-
description: 'Product metadata',
|
|
53
|
-
additionalProperties: true,
|
|
54
|
-
},
|
|
55
|
-
productId: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
description: 'Product Id',
|
|
58
|
-
},
|
|
59
|
-
productImageLink: {
|
|
60
|
-
type: 'string',
|
|
61
|
-
description: 'Product image link (thumbnail)',
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
required: ['name', 'price', 'productLink', 'quantity'],
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
'x-user-id': {
|
|
68
|
-
type: 'string',
|
|
69
|
-
},
|
|
70
|
-
checkVariantAvailability: {
|
|
71
|
-
type: 'boolean',
|
|
72
|
-
description: 'Whether to check variant availability after adding to cart. If true, variant check requests will be created for products with metadata and requestIds returned.',
|
|
73
|
-
},
|
|
74
|
-
jq_filter: {
|
|
75
|
-
type: 'string',
|
|
76
|
-
title: 'jq Filter',
|
|
77
|
-
description: 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
required: ['productsDetails', 'x-user-id'],
|
|
81
|
-
},
|
|
82
|
-
annotations: {},
|
|
83
|
-
};
|
|
84
|
-
const handler = async (client, args) => {
|
|
85
|
-
const { jq_filter, ...body } = args;
|
|
86
|
-
try {
|
|
87
|
-
return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.cart.items.add(body)));
|
|
88
|
-
}
|
|
89
|
-
catch (error) {
|
|
90
|
-
if (error instanceof sdk_1.default.APIError || (0, filtering_1.isJqError)(error)) {
|
|
91
|
-
return (0, types_1.asErrorResult)(error.message);
|
|
92
|
-
}
|
|
93
|
-
throw error;
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
exports.handler = handler;
|
|
97
|
-
exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
|
|
98
|
-
//# sourceMappingURL=add-cart-items.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-cart-items.js","sourceRoot":"","sources":["../../../src/tools/cart/items/add-cart-items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;AAEtF,wDAAkE;AAClE,sDAA0F;AAG1F,yDAAsC;AAEzB,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,cAAc;CAC5B,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,8oJAA8oJ;IAChpJ,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,eAAe,EAAE;gBACf,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE;4BACJ,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,cAAc;yBAC5B;wBACD,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,eAAe;yBAC7B;wBACD,WAAW,EAAE;4BACX,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,cAAc;yBAC5B;wBACD,QAAQ,EAAE;4BACR,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,UAAU;yBACxB;wBACD,oBAAoB,EAAE;4BACpB,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,iGAAiG;yBACpG;wBACD,QAAQ,EAAE;4BACR,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,kBAAkB;4BAC/B,oBAAoB,EAAE,IAAI;yBAC3B;wBACD,SAAS,EAAE;4BACT,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,YAAY;yBAC1B;wBACD,gBAAgB,EAAE;4BAChB,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,gCAAgC;yBAC9C;qBACF;oBACD,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,CAAC;iBACvD;aACF;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;aACf;YACD,wBAAwB,EAAE;gBACxB,IAAI,EAAE,SAAS;gBACf,WAAW,EACT,iKAAiK;aACpK;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,iBAAiB,EAAE,WAAW,CAAC;KAC3C;IACD,WAAW,EAAE,EAAE;CAChB,CAAC;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAyC,EAAE,EAAE;IAC3F,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAC3C,IAAI,CAAC;QACH,OAAO,IAAA,2BAAmB,EAAC,MAAM,IAAA,uBAAW,EAAC,SAAS,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9F,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,aAAQ,CAAC,QAAQ,IAAI,IAAA,qBAAS,EAAC,KAAK,CAAC,EAAE,CAAC;YAC3D,OAAO,IAAA,qBAAa,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,OAAO,WAUlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
|
-
import { asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
4
|
-
import HenrySDK from '@henrylabs/sdk';
|
|
5
|
-
export const metadata = {
|
|
6
|
-
resource: 'cart.items',
|
|
7
|
-
operation: 'write',
|
|
8
|
-
tags: [],
|
|
9
|
-
httpMethod: 'post',
|
|
10
|
-
httpPath: '/cart/items',
|
|
11
|
-
operationId: 'addCartItems',
|
|
12
|
-
};
|
|
13
|
-
export const tool = {
|
|
14
|
-
name: 'add_cart_items',
|
|
15
|
-
description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nAdd products to cart or update quantities if already in cart.\n\nRequired fields per product:\n- name: Product name (from retrieve_product_details)\n- price: Price as string, e.g. \"29.99\" (from stores[0].price)\n- productLink: Store URL (from stores[0].link - MUST call retrieve_product_details first)\n- quantity: Number of items\n\nOptional but IMPORTANT:\n- metadata: Object containing variant selections (size, color, etc.)\n Example: {\"size\": \"Large\", \"color\": \"Blue\"}\n- productImageLink: Thumbnail URL (from thumbnails[0])\n- affiliateProductLink: Use instead of productLink for affiliate tracking\n- productId: Include for easier tracking\n\nVARIANT HANDLING:\nIf retrieve_product_details shows variants array, you MUST:\n1. Show variants to user: \"Available sizes: S, M, L, XL\"\n2. Get user's selection\n3. Include in metadata: {\"size\": \"L\"}\n\nOptional: Set checkVariantAvailability: true to verify variants exist at stores\n\nReturns:\n- added_products: New items in cart\n- updated_products: Items with quantity increases\n- cart_summary: total_items and total_unique_products\n- variant_checks: Availability verification results (if requested)\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/item_add_response',\n $defs: {\n item_add_response: {\n type: 'object',\n properties: {\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n },\n data: {\n type: 'object',\n properties: {\n added_products: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: {\n type: 'string'\n },\n price: {\n type: 'string'\n },\n productId: {\n type: 'string'\n },\n quantity: {\n type: 'number'\n }\n },\n required: [ 'name',\n 'price',\n 'productId',\n 'quantity'\n ]\n }\n },\n cart_summary: {\n type: 'object',\n properties: {\n total_items: {\n type: 'number'\n },\n total_unique_products: {\n type: 'number'\n }\n },\n required: [ 'total_items',\n 'total_unique_products'\n ]\n },\n updated_products: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n addedQuantity: {\n type: 'number'\n },\n name: {\n type: 'string'\n },\n previousQuantity: {\n type: 'number'\n },\n price: {\n type: 'string'\n },\n productId: {\n type: 'string'\n },\n quantity: {\n type: 'number'\n }\n },\n required: [ 'addedQuantity',\n 'name',\n 'previousQuantity',\n 'price',\n 'productId',\n 'quantity'\n ]\n }\n },\n variant_checks: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n productId: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n variantCheckRequestId: {\n type: 'string'\n }\n },\n required: [ 'productId',\n 'status',\n 'variantCheckRequestId'\n ]\n }\n }\n },\n required: [ 'added_products',\n 'cart_summary',\n 'updated_products'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
16
|
-
inputSchema: {
|
|
17
|
-
type: 'object',
|
|
18
|
-
properties: {
|
|
19
|
-
productsDetails: {
|
|
20
|
-
type: 'array',
|
|
21
|
-
items: {
|
|
22
|
-
type: 'object',
|
|
23
|
-
properties: {
|
|
24
|
-
name: {
|
|
25
|
-
type: 'string',
|
|
26
|
-
description: 'Product name',
|
|
27
|
-
},
|
|
28
|
-
price: {
|
|
29
|
-
type: 'string',
|
|
30
|
-
description: 'Product price',
|
|
31
|
-
},
|
|
32
|
-
productLink: {
|
|
33
|
-
type: 'string',
|
|
34
|
-
description: 'Product link',
|
|
35
|
-
},
|
|
36
|
-
quantity: {
|
|
37
|
-
type: 'number',
|
|
38
|
-
description: 'Quantity',
|
|
39
|
-
},
|
|
40
|
-
affiliateProductLink: {
|
|
41
|
-
type: 'string',
|
|
42
|
-
description: 'Affiliate product link (if provided, will be used instead of productLink for order fulfillment)',
|
|
43
|
-
},
|
|
44
|
-
metadata: {
|
|
45
|
-
type: 'object',
|
|
46
|
-
description: 'Product metadata',
|
|
47
|
-
additionalProperties: true,
|
|
48
|
-
},
|
|
49
|
-
productId: {
|
|
50
|
-
type: 'string',
|
|
51
|
-
description: 'Product Id',
|
|
52
|
-
},
|
|
53
|
-
productImageLink: {
|
|
54
|
-
type: 'string',
|
|
55
|
-
description: 'Product image link (thumbnail)',
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
required: ['name', 'price', 'productLink', 'quantity'],
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
'x-user-id': {
|
|
62
|
-
type: 'string',
|
|
63
|
-
},
|
|
64
|
-
checkVariantAvailability: {
|
|
65
|
-
type: 'boolean',
|
|
66
|
-
description: 'Whether to check variant availability after adding to cart. If true, variant check requests will be created for products with metadata and requestIds returned.',
|
|
67
|
-
},
|
|
68
|
-
jq_filter: {
|
|
69
|
-
type: 'string',
|
|
70
|
-
title: 'jq Filter',
|
|
71
|
-
description: 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
required: ['productsDetails', 'x-user-id'],
|
|
75
|
-
},
|
|
76
|
-
annotations: {},
|
|
77
|
-
};
|
|
78
|
-
export const handler = async (client, args) => {
|
|
79
|
-
const { jq_filter, ...body } = args;
|
|
80
|
-
try {
|
|
81
|
-
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.add(body)));
|
|
82
|
-
}
|
|
83
|
-
catch (error) {
|
|
84
|
-
if (error instanceof HenrySDK.APIError || isJqError(error)) {
|
|
85
|
-
return asErrorResult(error.message);
|
|
86
|
-
}
|
|
87
|
-
throw error;
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
export default { metadata, tool, handler };
|
|
91
|
-
//# sourceMappingURL=add-cart-items.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-cart-items.mjs","sourceRoot":"","sources":["../../../src/tools/cart/items/add-cart-items.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC1D,EAAY,aAAa,EAAE,mBAAmB,EAAE,MAAM,4BAA4B;OAGlF,QAAQ,MAAM,gBAAgB;AAErC,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,cAAc;CAC5B,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EACT,8oJAA8oJ;IAChpJ,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,eAAe,EAAE;gBACf,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE;4BACJ,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,cAAc;yBAC5B;wBACD,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,eAAe;yBAC7B;wBACD,WAAW,EAAE;4BACX,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,cAAc;yBAC5B;wBACD,QAAQ,EAAE;4BACR,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,UAAU;yBACxB;wBACD,oBAAoB,EAAE;4BACpB,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,iGAAiG;yBACpG;wBACD,QAAQ,EAAE;4BACR,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,kBAAkB;4BAC/B,oBAAoB,EAAE,IAAI;yBAC3B;wBACD,SAAS,EAAE;4BACT,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,YAAY;yBAC1B;wBACD,gBAAgB,EAAE;4BAChB,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,gCAAgC;yBAC9C;qBACF;oBACD,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,CAAC;iBACvD;aACF;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;aACf;YACD,wBAAwB,EAAE;gBACxB,IAAI,EAAE,SAAS;gBACf,WAAW,EACT,iKAAiK;aACpK;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,iBAAiB,EAAE,WAAW,CAAC;KAC3C;IACD,WAAW,EAAE,EAAE;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAyC,EAAE,EAAE;IAC3F,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAC3C,IAAI,CAAC;QACH,OAAO,mBAAmB,CAAC,MAAM,WAAW,CAAC,SAAS,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9F,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,QAAQ,CAAC,QAAQ,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3D,OAAO,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Metadata } from '@henrylabs/mcp/tools/types';
|
|
2
|
-
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
-
import HenrySDK from '@henrylabs/sdk';
|
|
4
|
-
export declare const metadata: Metadata;
|
|
5
|
-
export declare const tool: Tool;
|
|
6
|
-
export declare const handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
7
|
-
declare const _default: {
|
|
8
|
-
metadata: Metadata;
|
|
9
|
-
tool: {
|
|
10
|
-
inputSchema: {
|
|
11
|
-
[x: string]: unknown;
|
|
12
|
-
type: "object";
|
|
13
|
-
properties?: {
|
|
14
|
-
[x: string]: object;
|
|
15
|
-
} | undefined;
|
|
16
|
-
required?: string[] | undefined;
|
|
17
|
-
};
|
|
18
|
-
name: string;
|
|
19
|
-
description?: string | undefined;
|
|
20
|
-
outputSchema?: {
|
|
21
|
-
[x: string]: unknown;
|
|
22
|
-
type: "object";
|
|
23
|
-
properties?: {
|
|
24
|
-
[x: string]: object;
|
|
25
|
-
} | undefined;
|
|
26
|
-
required?: string[] | undefined;
|
|
27
|
-
} | undefined;
|
|
28
|
-
annotations?: {
|
|
29
|
-
title?: string | undefined;
|
|
30
|
-
readOnlyHint?: boolean | undefined;
|
|
31
|
-
destructiveHint?: boolean | undefined;
|
|
32
|
-
idempotentHint?: boolean | undefined;
|
|
33
|
-
openWorldHint?: boolean | undefined;
|
|
34
|
-
} | undefined;
|
|
35
|
-
execution?: {
|
|
36
|
-
taskSupport?: "optional" | "required" | "forbidden" | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
_meta?: {
|
|
39
|
-
[x: string]: unknown;
|
|
40
|
-
} | undefined;
|
|
41
|
-
icons?: {
|
|
42
|
-
src: string;
|
|
43
|
-
mimeType?: string | undefined;
|
|
44
|
-
sizes?: string[] | undefined;
|
|
45
|
-
}[] | undefined;
|
|
46
|
-
title?: string | undefined;
|
|
47
|
-
};
|
|
48
|
-
handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
49
|
-
};
|
|
50
|
-
export default _default;
|
|
51
|
-
//# sourceMappingURL=clear-cart-items.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clear-cart-items.d.mts","sourceRoot":"","sources":["../../../src/tools/cart/items/clear-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,gBAAgB;AAErC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAsBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYzF,wBAA2C"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Metadata } from '@henrylabs/mcp/tools/types';
|
|
2
|
-
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
-
import HenrySDK from '@henrylabs/sdk';
|
|
4
|
-
export declare const metadata: Metadata;
|
|
5
|
-
export declare const tool: Tool;
|
|
6
|
-
export declare const handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
7
|
-
declare const _default: {
|
|
8
|
-
metadata: Metadata;
|
|
9
|
-
tool: {
|
|
10
|
-
inputSchema: {
|
|
11
|
-
[x: string]: unknown;
|
|
12
|
-
type: "object";
|
|
13
|
-
properties?: {
|
|
14
|
-
[x: string]: object;
|
|
15
|
-
} | undefined;
|
|
16
|
-
required?: string[] | undefined;
|
|
17
|
-
};
|
|
18
|
-
name: string;
|
|
19
|
-
description?: string | undefined;
|
|
20
|
-
outputSchema?: {
|
|
21
|
-
[x: string]: unknown;
|
|
22
|
-
type: "object";
|
|
23
|
-
properties?: {
|
|
24
|
-
[x: string]: object;
|
|
25
|
-
} | undefined;
|
|
26
|
-
required?: string[] | undefined;
|
|
27
|
-
} | undefined;
|
|
28
|
-
annotations?: {
|
|
29
|
-
title?: string | undefined;
|
|
30
|
-
readOnlyHint?: boolean | undefined;
|
|
31
|
-
destructiveHint?: boolean | undefined;
|
|
32
|
-
idempotentHint?: boolean | undefined;
|
|
33
|
-
openWorldHint?: boolean | undefined;
|
|
34
|
-
} | undefined;
|
|
35
|
-
execution?: {
|
|
36
|
-
taskSupport?: "optional" | "required" | "forbidden" | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
_meta?: {
|
|
39
|
-
[x: string]: unknown;
|
|
40
|
-
} | undefined;
|
|
41
|
-
icons?: {
|
|
42
|
-
src: string;
|
|
43
|
-
mimeType?: string | undefined;
|
|
44
|
-
sizes?: string[] | undefined;
|
|
45
|
-
}[] | undefined;
|
|
46
|
-
title?: string | undefined;
|
|
47
|
-
};
|
|
48
|
-
handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
49
|
-
};
|
|
50
|
-
export default _default;
|
|
51
|
-
//# sourceMappingURL=clear-cart-items.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clear-cart-items.d.ts","sourceRoot":"","sources":["../../../src/tools/cart/items/clear-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,gBAAgB;AAErC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAsBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYzF,wBAA2C"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.handler = exports.tool = exports.metadata = void 0;
|
|
8
|
-
const filtering_1 = require("@henrylabs/mcp/filtering");
|
|
9
|
-
const types_1 = require("@henrylabs/mcp/tools/types");
|
|
10
|
-
const sdk_1 = __importDefault(require("@henrylabs/sdk"));
|
|
11
|
-
exports.metadata = {
|
|
12
|
-
resource: 'cart.items',
|
|
13
|
-
operation: 'write',
|
|
14
|
-
tags: [],
|
|
15
|
-
httpMethod: 'delete',
|
|
16
|
-
httpPath: '/cart/items',
|
|
17
|
-
operationId: 'deleteAllCartItems',
|
|
18
|
-
};
|
|
19
|
-
exports.tool = {
|
|
20
|
-
name: 'clear_cart_items',
|
|
21
|
-
description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nRemove ALL products from the cart. Cannot be undone.\n\nUse when:\n- User wants to start over\n- Clearing abandoned cart\n- After successful order completion\n\nReturns success confirmation message.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/item_clear_response',\n $defs: {\n item_clear_response: {\n type: 'object',\n properties: {\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
|
-
inputSchema: {
|
|
23
|
-
type: 'object',
|
|
24
|
-
properties: {
|
|
25
|
-
'x-user-id': {
|
|
26
|
-
type: 'string',
|
|
27
|
-
},
|
|
28
|
-
jq_filter: {
|
|
29
|
-
type: 'string',
|
|
30
|
-
title: 'jq Filter',
|
|
31
|
-
description: 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
required: ['x-user-id'],
|
|
35
|
-
},
|
|
36
|
-
annotations: {
|
|
37
|
-
idempotentHint: true,
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
const handler = async (client, args) => {
|
|
41
|
-
const { jq_filter, ...body } = args;
|
|
42
|
-
try {
|
|
43
|
-
return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.cart.items.clear(body)));
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
if (error instanceof sdk_1.default.APIError || (0, filtering_1.isJqError)(error)) {
|
|
47
|
-
return (0, types_1.asErrorResult)(error.message);
|
|
48
|
-
}
|
|
49
|
-
throw error;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
exports.handler = handler;
|
|
53
|
-
exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
|
|
54
|
-
//# sourceMappingURL=clear-cart-items.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clear-cart-items.js","sourceRoot":"","sources":["../../../src/tools/cart/items/clear-cart-items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;AAEtF,wDAAkE;AAClE,sDAA0F;AAG1F,yDAAsC;AAEzB,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,QAAQ;IACpB,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,oBAAoB;CAClC,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EACT,8yBAA8yB;IAChzB,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;aACf;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;IACD,WAAW,EAAE;QACX,cAAc,EAAE,IAAI;KACrB;CACF,CAAC;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAyC,EAAE,EAAE;IAC3F,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAC3C,IAAI,CAAC;QACH,OAAO,IAAA,2BAAmB,EAAC,MAAM,IAAA,uBAAW,EAAC,SAAS,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChG,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,aAAQ,CAAC,QAAQ,IAAI,IAAA,qBAAS,EAAC,KAAK,CAAC,EAAE,CAAC;YAC3D,OAAO,IAAA,qBAAa,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,OAAO,WAUlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
|
-
import { asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
4
|
-
import HenrySDK from '@henrylabs/sdk';
|
|
5
|
-
export const metadata = {
|
|
6
|
-
resource: 'cart.items',
|
|
7
|
-
operation: 'write',
|
|
8
|
-
tags: [],
|
|
9
|
-
httpMethod: 'delete',
|
|
10
|
-
httpPath: '/cart/items',
|
|
11
|
-
operationId: 'deleteAllCartItems',
|
|
12
|
-
};
|
|
13
|
-
export const tool = {
|
|
14
|
-
name: 'clear_cart_items',
|
|
15
|
-
description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nRemove ALL products from the cart. Cannot be undone.\n\nUse when:\n- User wants to start over\n- Clearing abandoned cart\n- After successful order completion\n\nReturns success confirmation message.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/item_clear_response',\n $defs: {\n item_clear_response: {\n type: 'object',\n properties: {\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
16
|
-
inputSchema: {
|
|
17
|
-
type: 'object',
|
|
18
|
-
properties: {
|
|
19
|
-
'x-user-id': {
|
|
20
|
-
type: 'string',
|
|
21
|
-
},
|
|
22
|
-
jq_filter: {
|
|
23
|
-
type: 'string',
|
|
24
|
-
title: 'jq Filter',
|
|
25
|
-
description: 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
required: ['x-user-id'],
|
|
29
|
-
},
|
|
30
|
-
annotations: {
|
|
31
|
-
idempotentHint: true,
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
export const handler = async (client, args) => {
|
|
35
|
-
const { jq_filter, ...body } = args;
|
|
36
|
-
try {
|
|
37
|
-
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.clear(body)));
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
if (error instanceof HenrySDK.APIError || isJqError(error)) {
|
|
41
|
-
return asErrorResult(error.message);
|
|
42
|
-
}
|
|
43
|
-
throw error;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
export default { metadata, tool, handler };
|
|
47
|
-
//# sourceMappingURL=clear-cart-items.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clear-cart-items.mjs","sourceRoot":"","sources":["../../../src/tools/cart/items/clear-cart-items.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC1D,EAAY,aAAa,EAAE,mBAAmB,EAAE,MAAM,4BAA4B;OAGlF,QAAQ,MAAM,gBAAgB;AAErC,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,QAAQ;IACpB,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,oBAAoB;CAClC,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EACT,8yBAA8yB;IAChzB,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;aACf;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;IACD,WAAW,EAAE;QACX,cAAc,EAAE,IAAI;KACrB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAyC,EAAE,EAAE;IAC3F,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAC3C,IAAI,CAAC;QACH,OAAO,mBAAmB,CAAC,MAAM,WAAW,CAAC,SAAS,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAChG,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,QAAQ,CAAC,QAAQ,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3D,OAAO,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Metadata } from '@henrylabs/mcp/tools/types';
|
|
2
|
-
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
-
import HenrySDK from '@henrylabs/sdk';
|
|
4
|
-
export declare const metadata: Metadata;
|
|
5
|
-
export declare const tool: Tool;
|
|
6
|
-
export declare const handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
7
|
-
declare const _default: {
|
|
8
|
-
metadata: Metadata;
|
|
9
|
-
tool: {
|
|
10
|
-
inputSchema: {
|
|
11
|
-
[x: string]: unknown;
|
|
12
|
-
type: "object";
|
|
13
|
-
properties?: {
|
|
14
|
-
[x: string]: object;
|
|
15
|
-
} | undefined;
|
|
16
|
-
required?: string[] | undefined;
|
|
17
|
-
};
|
|
18
|
-
name: string;
|
|
19
|
-
description?: string | undefined;
|
|
20
|
-
outputSchema?: {
|
|
21
|
-
[x: string]: unknown;
|
|
22
|
-
type: "object";
|
|
23
|
-
properties?: {
|
|
24
|
-
[x: string]: object;
|
|
25
|
-
} | undefined;
|
|
26
|
-
required?: string[] | undefined;
|
|
27
|
-
} | undefined;
|
|
28
|
-
annotations?: {
|
|
29
|
-
title?: string | undefined;
|
|
30
|
-
readOnlyHint?: boolean | undefined;
|
|
31
|
-
destructiveHint?: boolean | undefined;
|
|
32
|
-
idempotentHint?: boolean | undefined;
|
|
33
|
-
openWorldHint?: boolean | undefined;
|
|
34
|
-
} | undefined;
|
|
35
|
-
execution?: {
|
|
36
|
-
taskSupport?: "optional" | "required" | "forbidden" | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
_meta?: {
|
|
39
|
-
[x: string]: unknown;
|
|
40
|
-
} | undefined;
|
|
41
|
-
icons?: {
|
|
42
|
-
src: string;
|
|
43
|
-
mimeType?: string | undefined;
|
|
44
|
-
sizes?: string[] | undefined;
|
|
45
|
-
}[] | undefined;
|
|
46
|
-
title?: string | undefined;
|
|
47
|
-
};
|
|
48
|
-
handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
49
|
-
};
|
|
50
|
-
export default _default;
|
|
51
|
-
//# sourceMappingURL=list-cart-items.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-cart-items.d.mts","sourceRoot":"","sources":["../../../src/tools/cart/items/list-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,gBAAgB;AAErC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAsBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYzF,wBAA2C"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Metadata } from '@henrylabs/mcp/tools/types';
|
|
2
|
-
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
-
import HenrySDK from '@henrylabs/sdk';
|
|
4
|
-
export declare const metadata: Metadata;
|
|
5
|
-
export declare const tool: Tool;
|
|
6
|
-
export declare const handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
7
|
-
declare const _default: {
|
|
8
|
-
metadata: Metadata;
|
|
9
|
-
tool: {
|
|
10
|
-
inputSchema: {
|
|
11
|
-
[x: string]: unknown;
|
|
12
|
-
type: "object";
|
|
13
|
-
properties?: {
|
|
14
|
-
[x: string]: object;
|
|
15
|
-
} | undefined;
|
|
16
|
-
required?: string[] | undefined;
|
|
17
|
-
};
|
|
18
|
-
name: string;
|
|
19
|
-
description?: string | undefined;
|
|
20
|
-
outputSchema?: {
|
|
21
|
-
[x: string]: unknown;
|
|
22
|
-
type: "object";
|
|
23
|
-
properties?: {
|
|
24
|
-
[x: string]: object;
|
|
25
|
-
} | undefined;
|
|
26
|
-
required?: string[] | undefined;
|
|
27
|
-
} | undefined;
|
|
28
|
-
annotations?: {
|
|
29
|
-
title?: string | undefined;
|
|
30
|
-
readOnlyHint?: boolean | undefined;
|
|
31
|
-
destructiveHint?: boolean | undefined;
|
|
32
|
-
idempotentHint?: boolean | undefined;
|
|
33
|
-
openWorldHint?: boolean | undefined;
|
|
34
|
-
} | undefined;
|
|
35
|
-
execution?: {
|
|
36
|
-
taskSupport?: "optional" | "required" | "forbidden" | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
_meta?: {
|
|
39
|
-
[x: string]: unknown;
|
|
40
|
-
} | undefined;
|
|
41
|
-
icons?: {
|
|
42
|
-
src: string;
|
|
43
|
-
mimeType?: string | undefined;
|
|
44
|
-
sizes?: string[] | undefined;
|
|
45
|
-
}[] | undefined;
|
|
46
|
-
title?: string | undefined;
|
|
47
|
-
};
|
|
48
|
-
handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
49
|
-
};
|
|
50
|
-
export default _default;
|
|
51
|
-
//# sourceMappingURL=list-cart-items.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-cart-items.d.ts","sourceRoot":"","sources":["../../../src/tools/cart/items/list-cart-items.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAsC,MAAM,4BAA4B;OAElF,EAAE,IAAI,EAAE,MAAM,oCAAoC;OAClD,QAAQ,MAAM,gBAAgB;AAErC,eAAO,MAAM,QAAQ,EAAE,QAOtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,IAsBlB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAUxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAVoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAYzF,wBAA2C"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.handler = exports.tool = exports.metadata = void 0;
|
|
8
|
-
const filtering_1 = require("@henrylabs/mcp/filtering");
|
|
9
|
-
const types_1 = require("@henrylabs/mcp/tools/types");
|
|
10
|
-
const sdk_1 = __importDefault(require("@henrylabs/sdk"));
|
|
11
|
-
exports.metadata = {
|
|
12
|
-
resource: 'cart.items',
|
|
13
|
-
operation: 'read',
|
|
14
|
-
tags: [],
|
|
15
|
-
httpMethod: 'get',
|
|
16
|
-
httpPath: '/cart/items',
|
|
17
|
-
operationId: 'getCartItems',
|
|
18
|
-
};
|
|
19
|
-
exports.tool = {
|
|
20
|
-
name: 'list_cart_items',
|
|
21
|
-
description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nRetrieve all products currently in the user's cart.\n\nReturns products array with:\n- name, price, productLink, quantity\n- productId (if provided when added)\n- metadata (variant selections)\n- productImageLink (thumbnail)\n- affiliateProductLink (if used)\n\nUse this to:\n- Show cart contents before checkout\n- Calculate totals\n- Verify items before creating checkout\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/item_list_response',\n $defs: {\n item_list_response: {\n type: 'object',\n properties: {\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n },\n data: {\n type: 'object',\n properties: {\n products: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: {\n type: 'string',\n description: 'Product name'\n },\n price: {\n type: 'string',\n description: 'Product price'\n },\n productLink: {\n type: 'string',\n description: 'Product link'\n },\n quantity: {\n type: 'number',\n description: 'Quantity'\n },\n affiliateProductLink: {\n type: 'string',\n description: 'Affiliate product link (if provided, will be used instead of productLink for order fulfillment)'\n },\n metadata: {\n type: 'object',\n description: 'Product metadata',\n additionalProperties: true\n },\n productId: {\n type: 'string',\n description: 'Product Id'\n },\n productImageLink: {\n type: 'string',\n description: 'Product image link (thumbnail)'\n }\n },\n required: [ 'name',\n 'price',\n 'productLink',\n 'quantity'\n ]\n }\n }\n },\n required: [ 'products'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
|
-
inputSchema: {
|
|
23
|
-
type: 'object',
|
|
24
|
-
properties: {
|
|
25
|
-
'x-user-id': {
|
|
26
|
-
type: 'string',
|
|
27
|
-
},
|
|
28
|
-
jq_filter: {
|
|
29
|
-
type: 'string',
|
|
30
|
-
title: 'jq Filter',
|
|
31
|
-
description: 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
required: ['x-user-id'],
|
|
35
|
-
},
|
|
36
|
-
annotations: {
|
|
37
|
-
readOnlyHint: true,
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
const handler = async (client, args) => {
|
|
41
|
-
const { jq_filter, ...body } = args;
|
|
42
|
-
try {
|
|
43
|
-
return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.cart.items.list(body)));
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
if (error instanceof sdk_1.default.APIError || (0, filtering_1.isJqError)(error)) {
|
|
47
|
-
return (0, types_1.asErrorResult)(error.message);
|
|
48
|
-
}
|
|
49
|
-
throw error;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
exports.handler = handler;
|
|
53
|
-
exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
|
|
54
|
-
//# sourceMappingURL=list-cart-items.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-cart-items.js","sourceRoot":"","sources":["../../../src/tools/cart/items/list-cart-items.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;AAEtF,wDAAkE;AAClE,sDAA0F;AAG1F,yDAAsC;AAEzB,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,YAAY;IACtB,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,cAAc;CAC5B,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,ytFAAytF;IAC3tF,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;aACf;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;IACD,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;KACnB;CACF,CAAC;AAEK,MAAM,OAAO,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAyC,EAAE,EAAE;IAC3F,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAC3C,IAAI,CAAC;QACH,OAAO,IAAA,2BAAmB,EAAC,MAAM,IAAA,uBAAW,EAAC,SAAS,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/F,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,aAAQ,CAAC,QAAQ,IAAI,IAAA,qBAAS,EAAC,KAAK,CAAC,EAAE,CAAC;YAC3D,OAAO,IAAA,qBAAa,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,OAAO,WAUlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
|