@henrylabs/mcp 0.10.0 → 0.11.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/filtering.d.mts +1 -0
- package/filtering.d.mts.map +1 -1
- package/filtering.d.ts +1 -0
- package/filtering.d.ts.map +1 -1
- package/filtering.js +4 -0
- package/filtering.js.map +1 -1
- package/filtering.mjs +3 -0
- package/filtering.mjs.map +1 -1
- package/package.json +3 -3
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/src/filtering.ts +4 -0
- package/src/server.ts +1 -1
- package/src/tools/cart/create-cart-checkout.ts +10 -3
- package/src/tools/cart/items/add-cart-items.ts +10 -3
- package/src/tools/cart/items/clear-cart-items.ts +10 -3
- package/src/tools/cart/items/list-cart-items.ts +10 -3
- package/src/tools/cart/items/remove-cart-items.ts +10 -3
- package/src/tools/checkout/session/confirm-checkout-session.ts +12 -5
- package/src/tools/checkout/session/create-checkout-session.ts +10 -3
- package/src/tools/orders/retrieve-status-orders.ts +10 -3
- package/src/tools/products/retrieve-product-details.ts +3 -10
- package/src/tools/products/search-products.ts +43 -11
- package/src/tools/types.ts +12 -0
- package/src/tools/wallet/collect-payment-details.ts +10 -3
- package/tools/cart/create-cart-checkout.d.mts.map +1 -1
- package/tools/cart/create-cart-checkout.d.ts.map +1 -1
- package/tools/cart/create-cart-checkout.js +9 -1
- package/tools/cart/create-cart-checkout.js.map +1 -1
- package/tools/cart/create-cart-checkout.mjs +11 -3
- package/tools/cart/create-cart-checkout.mjs.map +1 -1
- package/tools/cart/items/add-cart-items.d.mts.map +1 -1
- package/tools/cart/items/add-cart-items.d.ts.map +1 -1
- package/tools/cart/items/add-cart-items.js +9 -1
- package/tools/cart/items/add-cart-items.js.map +1 -1
- package/tools/cart/items/add-cart-items.mjs +11 -3
- package/tools/cart/items/add-cart-items.mjs.map +1 -1
- package/tools/cart/items/clear-cart-items.d.mts.map +1 -1
- package/tools/cart/items/clear-cart-items.d.ts.map +1 -1
- package/tools/cart/items/clear-cart-items.js +9 -1
- package/tools/cart/items/clear-cart-items.js.map +1 -1
- package/tools/cart/items/clear-cart-items.mjs +11 -3
- package/tools/cart/items/clear-cart-items.mjs.map +1 -1
- package/tools/cart/items/list-cart-items.d.mts.map +1 -1
- package/tools/cart/items/list-cart-items.d.ts.map +1 -1
- package/tools/cart/items/list-cart-items.js +9 -1
- package/tools/cart/items/list-cart-items.js.map +1 -1
- package/tools/cart/items/list-cart-items.mjs +11 -3
- package/tools/cart/items/list-cart-items.mjs.map +1 -1
- package/tools/cart/items/remove-cart-items.d.mts.map +1 -1
- package/tools/cart/items/remove-cart-items.d.ts.map +1 -1
- package/tools/cart/items/remove-cart-items.js +9 -1
- package/tools/cart/items/remove-cart-items.js.map +1 -1
- package/tools/cart/items/remove-cart-items.mjs +11 -3
- package/tools/cart/items/remove-cart-items.mjs.map +1 -1
- package/tools/checkout/session/confirm-checkout-session.d.mts.map +1 -1
- package/tools/checkout/session/confirm-checkout-session.d.ts.map +1 -1
- package/tools/checkout/session/confirm-checkout-session.js +9 -1
- package/tools/checkout/session/confirm-checkout-session.js.map +1 -1
- package/tools/checkout/session/confirm-checkout-session.mjs +11 -3
- package/tools/checkout/session/confirm-checkout-session.mjs.map +1 -1
- package/tools/checkout/session/create-checkout-session.d.mts.map +1 -1
- package/tools/checkout/session/create-checkout-session.d.ts.map +1 -1
- package/tools/checkout/session/create-checkout-session.js +9 -1
- package/tools/checkout/session/create-checkout-session.js.map +1 -1
- package/tools/checkout/session/create-checkout-session.mjs +11 -3
- package/tools/checkout/session/create-checkout-session.mjs.map +1 -1
- package/tools/orders/retrieve-status-orders.d.mts.map +1 -1
- package/tools/orders/retrieve-status-orders.d.ts.map +1 -1
- package/tools/orders/retrieve-status-orders.js +9 -1
- package/tools/orders/retrieve-status-orders.js.map +1 -1
- package/tools/orders/retrieve-status-orders.mjs +11 -3
- package/tools/orders/retrieve-status-orders.mjs.map +1 -1
- package/tools/products/retrieve-product-details.d.mts.map +1 -1
- package/tools/products/retrieve-product-details.d.ts.map +1 -1
- package/tools/products/retrieve-product-details.js +3 -9
- package/tools/products/retrieve-product-details.js.map +1 -1
- package/tools/products/retrieve-product-details.mjs +3 -9
- package/tools/products/retrieve-product-details.mjs.map +1 -1
- package/tools/products/search-products.d.mts.map +1 -1
- package/tools/products/search-products.d.ts.map +1 -1
- package/tools/products/search-products.js +42 -9
- package/tools/products/search-products.js.map +1 -1
- package/tools/products/search-products.mjs +44 -11
- package/tools/products/search-products.mjs.map +1 -1
- package/tools/types.d.mts +1 -0
- package/tools/types.d.mts.map +1 -1
- package/tools/types.d.ts +1 -0
- package/tools/types.d.ts.map +1 -1
- package/tools/types.js +12 -0
- package/tools/types.js.map +1 -1
- package/tools/types.mjs +11 -0
- package/tools/types.mjs.map +1 -1
- package/tools/wallet/collect-payment-details.d.mts.map +1 -1
- package/tools/wallet/collect-payment-details.d.ts.map +1 -1
- package/tools/wallet/collect-payment-details.js +9 -1
- package/tools/wallet/collect-payment-details.js.map +1 -1
- package/tools/wallet/collect-payment-details.mjs +11 -3
- package/tools/wallet/collect-payment-details.mjs.map +1 -1
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.handler = exports.tool = exports.metadata = void 0;
|
|
5
|
-
const filtering_1 = require("@henrylabs/mcp/filtering");
|
|
6
5
|
const types_1 = require("@henrylabs/mcp/tools/types");
|
|
7
6
|
exports.metadata = {
|
|
8
7
|
resource: 'products',
|
|
@@ -14,7 +13,7 @@ exports.metadata = {
|
|
|
14
13
|
};
|
|
15
14
|
exports.tool = {
|
|
16
15
|
name: 'retrieve_product_details',
|
|
17
|
-
description:
|
|
16
|
+
description: 'Retrieve comprehensive product details using a product ID from search results.\n\nMUST BE CALLED BEFORE adding items to cart - this is the only way to get the productLink required for cart operations.\n\nReturns:\n- Product title, brand, rating, review count\n- Stores array with name, price, shipping, total, and LINK for each retailer\n- Available variants (sizes, colors, etc.) with availability status\n- Thumbnail images (multiple angles)\n',
|
|
18
17
|
inputSchema: {
|
|
19
18
|
type: 'object',
|
|
20
19
|
properties: {
|
|
@@ -22,11 +21,6 @@ exports.tool = {
|
|
|
22
21
|
type: 'string',
|
|
23
22
|
description: 'Product ID',
|
|
24
23
|
},
|
|
25
|
-
jq_filter: {
|
|
26
|
-
type: 'string',
|
|
27
|
-
title: 'jq Filter',
|
|
28
|
-
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/).',
|
|
29
|
-
},
|
|
30
24
|
},
|
|
31
25
|
required: ['productId'],
|
|
32
26
|
},
|
|
@@ -35,8 +29,8 @@ exports.tool = {
|
|
|
35
29
|
},
|
|
36
30
|
};
|
|
37
31
|
const handler = async (client, args) => {
|
|
38
|
-
const
|
|
39
|
-
return (0, types_1.asTextContentResult)(await
|
|
32
|
+
const body = args;
|
|
33
|
+
return (0, types_1.asTextContentResult)(await client.products.retrieveDetails(body));
|
|
40
34
|
};
|
|
41
35
|
exports.handler = handler;
|
|
42
36
|
exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrieve-product-details.js","sourceRoot":"","sources":["../../src/tools/products/retrieve-product-details.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"retrieve-product-details.js","sourceRoot":"","sources":["../../src/tools/products/retrieve-product-details.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,sDAA2E;AAK9D,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC5B,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,mBAAmB;IAC7B,WAAW,EAAE,mBAAmB;CACjC,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EACT,+bAA+b;IACjc,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,YAAY;aAC1B;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,IAAI,GAAG,IAAW,CAAC;IACzB,OAAO,IAAA,2BAAmB,EAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1E,CAAC,CAAC;AAHW,QAAA,OAAO,WAGlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
2
|
import { asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
4
3
|
export const metadata = {
|
|
5
4
|
resource: 'products',
|
|
@@ -11,7 +10,7 @@ export const metadata = {
|
|
|
11
10
|
};
|
|
12
11
|
export const tool = {
|
|
13
12
|
name: 'retrieve_product_details',
|
|
14
|
-
description:
|
|
13
|
+
description: 'Retrieve comprehensive product details using a product ID from search results.\n\nMUST BE CALLED BEFORE adding items to cart - this is the only way to get the productLink required for cart operations.\n\nReturns:\n- Product title, brand, rating, review count\n- Stores array with name, price, shipping, total, and LINK for each retailer\n- Available variants (sizes, colors, etc.) with availability status\n- Thumbnail images (multiple angles)\n',
|
|
15
14
|
inputSchema: {
|
|
16
15
|
type: 'object',
|
|
17
16
|
properties: {
|
|
@@ -19,11 +18,6 @@ export const tool = {
|
|
|
19
18
|
type: 'string',
|
|
20
19
|
description: 'Product ID',
|
|
21
20
|
},
|
|
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
21
|
},
|
|
28
22
|
required: ['productId'],
|
|
29
23
|
},
|
|
@@ -32,8 +26,8 @@ export const tool = {
|
|
|
32
26
|
},
|
|
33
27
|
};
|
|
34
28
|
export const handler = async (client, args) => {
|
|
35
|
-
const
|
|
36
|
-
return asTextContentResult(await
|
|
29
|
+
const body = args;
|
|
30
|
+
return asTextContentResult(await client.products.retrieveDetails(body));
|
|
37
31
|
};
|
|
38
32
|
export default { metadata, tool, handler };
|
|
39
33
|
//# sourceMappingURL=retrieve-product-details.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrieve-product-details.mjs","sourceRoot":"","sources":["../../src/tools/products/retrieve-product-details.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,
|
|
1
|
+
{"version":3,"file":"retrieve-product-details.mjs","sourceRoot":"","sources":["../../src/tools/products/retrieve-product-details.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAY,mBAAmB,EAAE,MAAM,4BAA4B;AAK1E,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC5B,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,mBAAmB;IAC7B,WAAW,EAAE,mBAAmB;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EACT,+bAA+b;IACjc,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,YAAY;aAC1B;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;IACD,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAyC,EAAE,EAAE;IAC3F,MAAM,IAAI,GAAG,IAAW,CAAC;IACzB,OAAO,mBAAmB,CAAC,MAAM,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1E,CAAC,CAAC;AAEF,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-products.d.mts","sourceRoot":"","sources":["../../src/tools/products/search-products.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"search-products.d.mts","sourceRoot":"","sources":["../../src/tools/products/search-products.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,IA8ElB,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-products.d.ts","sourceRoot":"","sources":["../../src/tools/products/search-products.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"search-products.d.ts","sourceRoot":"","sources":["../../src/tools/products/search-products.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,IA8ElB,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"}
|
|
@@ -14,7 +14,7 @@ exports.metadata = {
|
|
|
14
14
|
};
|
|
15
15
|
exports.tool = {
|
|
16
16
|
name: 'search_products',
|
|
17
|
-
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\nSearch for products using keywords and filters (price range, color, size, gender, manufacturer, region).\n\nReturns basic product information:\n- Product ID (required for next step)\n- Name, price, currency, description\n- Thumbnail image URL\n\nYou MUST call retrieve_product_details() with each product's ID to get:\n- Actual store links for purchasing\n- All available variants\n- Detailed reviews and ratings\n- Price comparisons across stores\n\nRecommended flow:\n1. search_products(query, filters) - Get product IDs\n2. retrieve_product_details(productId) - Get store URLs and variants for each\n3. Present results with images, prices, AND clickable store links\n\nCommon filters: limit (default 10), greaterThanPrice, lowerThanPrice, color, size, gender\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/product_search_response',\n $defs: {\n product_search_response: {\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string'\n },\n currency: {\n type: 'string'\n },\n description: {\n type: 'string'\n },\n imageUrl: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n price: {\n type: 'number'\n },\n source: {\n type: 'string'\n },\n originalPrice: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'currency',\n 'description',\n 'imageUrl',\n 'name',\n 'price',\n 'source'\n ]\n }\n },\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'data',\n 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
17
|
+
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\nSearch for products using keywords and filters (price range, color, size, gender, manufacturer, region).\n\nReturns basic product information:\n- Product ID (required for next step)\n- Name, price, currency, description\n- Thumbnail image URL\n\nYou MUST call retrieve_product_details() with each product's ID to get:\n- Actual store links for purchasing\n- All available variants\n- Detailed reviews and ratings\n- Price comparisons across stores\n\nRecommended flow:\n1. search_products(query, filters) - Get product IDs\n2. retrieve_product_details(productId) - Get store URLs and variants for each\n3. Present results with images, prices, AND clickable store links\n\nCommon filters: limit (default 10), greaterThanPrice, lowerThanPrice, color, size, gender\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/product_search_response',\n $defs: {\n product_search_response: {\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string'\n },\n currency: {\n type: 'string'\n },\n description: {\n type: 'string'\n },\n imageUrl: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n price: {\n type: 'number'\n },\n source: {\n type: 'string'\n },\n originalPrice: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'currency',\n 'description',\n 'imageUrl',\n 'name',\n 'price',\n 'source'\n ]\n }\n },\n message: {\n type: 'string'\n },\n pagination: {\n type: 'object',\n properties: {\n nextCursor: {\n type: 'string'\n },\n previousCursor: {\n type: 'string'\n }\n },\n required: [ 'nextCursor',\n 'previousCursor'\n ]\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'data',\n 'message',\n 'pagination',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
18
18
|
inputSchema: {
|
|
19
19
|
type: 'object',
|
|
20
20
|
properties: {
|
|
@@ -24,15 +24,23 @@ exports.tool = {
|
|
|
24
24
|
},
|
|
25
25
|
color: {
|
|
26
26
|
type: 'string',
|
|
27
|
-
description: '
|
|
27
|
+
description: '[Deprecated] Filter results by color',
|
|
28
|
+
},
|
|
29
|
+
cursor: {
|
|
30
|
+
type: 'integer',
|
|
31
|
+
description: 'Cursor returned from the previous response (SerpAPI start param)',
|
|
32
|
+
},
|
|
33
|
+
freeShipping: {
|
|
34
|
+
type: 'boolean',
|
|
35
|
+
description: 'Restrict results to listings with free shipping',
|
|
28
36
|
},
|
|
29
37
|
gender: {
|
|
30
38
|
type: 'string',
|
|
31
|
-
description: '
|
|
39
|
+
description: '[Deprecated] Filter results by gender',
|
|
32
40
|
},
|
|
33
41
|
greaterThanPrice: {
|
|
34
42
|
type: 'number',
|
|
35
|
-
description: '
|
|
43
|
+
description: '[Deprecated] Alias for minPrice. Maintained for backwards compatibility.',
|
|
36
44
|
},
|
|
37
45
|
limit: {
|
|
38
46
|
type: 'integer',
|
|
@@ -40,19 +48,36 @@ exports.tool = {
|
|
|
40
48
|
},
|
|
41
49
|
lowerThanPrice: {
|
|
42
50
|
type: 'number',
|
|
43
|
-
description: '
|
|
51
|
+
description: '[Deprecated] Alias for maxPrice. Maintained for backwards compatibility.',
|
|
44
52
|
},
|
|
45
53
|
manufacturer: {
|
|
46
54
|
type: 'string',
|
|
47
|
-
description: '
|
|
55
|
+
description: '[Deprecated] Filter results by manufacturer',
|
|
56
|
+
},
|
|
57
|
+
maxPrice: {
|
|
58
|
+
type: 'number',
|
|
59
|
+
description: 'Maximum price filter',
|
|
60
|
+
},
|
|
61
|
+
minPrice: {
|
|
62
|
+
type: 'number',
|
|
63
|
+
description: 'Minimum price filter',
|
|
48
64
|
},
|
|
49
65
|
region: {
|
|
50
66
|
type: 'string',
|
|
51
|
-
description: 'Region',
|
|
67
|
+
description: '[Deprecated] Region filter (defaults to `us`).',
|
|
52
68
|
},
|
|
53
69
|
size: {
|
|
54
70
|
type: 'string',
|
|
55
|
-
description: '
|
|
71
|
+
description: '[Deprecated] Filter results by size',
|
|
72
|
+
},
|
|
73
|
+
smallBusiness: {
|
|
74
|
+
type: 'boolean',
|
|
75
|
+
description: 'Restrict results to merchants labeled as small business',
|
|
76
|
+
},
|
|
77
|
+
sortBy: {
|
|
78
|
+
type: 'string',
|
|
79
|
+
description: 'Sort order: 1 = price low→high, 2 = price high→low',
|
|
80
|
+
enum: [1, 2],
|
|
56
81
|
},
|
|
57
82
|
jq_filter: {
|
|
58
83
|
type: 'string',
|
|
@@ -66,7 +91,15 @@ exports.tool = {
|
|
|
66
91
|
};
|
|
67
92
|
const handler = async (client, args) => {
|
|
68
93
|
const { jq_filter, ...body } = args;
|
|
69
|
-
|
|
94
|
+
try {
|
|
95
|
+
return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.products.search(body)));
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
if ((0, filtering_1.isJqError)(error)) {
|
|
99
|
+
return (0, types_1.asErrorResult)(error.message);
|
|
100
|
+
}
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
70
103
|
};
|
|
71
104
|
exports.handler = handler;
|
|
72
105
|
exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-products.js","sourceRoot":"","sources":["../../src/tools/products/search-products.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"search-products.js","sourceRoot":"","sources":["../../src/tools/products/search-products.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAkE;AAClE,sDAA0F;AAK7E,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC5B,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,kBAAkB;IAC5B,WAAW,EAAE,gBAAgB;CAC9B,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,4rFAA4rF;IAC9rF,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,cAAc;aAC5B;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sCAAsC;aACpD;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,kEAAkE;aAChF;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,iDAAiD;aAC/D;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uCAAuC;aACrD;YACD,gBAAgB,EAAE;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0EAA0E;aACxF;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,6BAA6B;aAC3C;YACD,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0EAA0E;aACxF;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6CAA6C;aAC3D;YACD,QAAQ,EAA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,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
|
-
import { asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
2
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
|
+
import { asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
4
4
|
export const metadata = {
|
|
5
5
|
resource: 'products',
|
|
6
6
|
operation: 'write',
|
|
@@ -11,7 +11,7 @@ export const metadata = {
|
|
|
11
11
|
};
|
|
12
12
|
export const tool = {
|
|
13
13
|
name: 'search_products',
|
|
14
|
-
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\nSearch for products using keywords and filters (price range, color, size, gender, manufacturer, region).\n\nReturns basic product information:\n- Product ID (required for next step)\n- Name, price, currency, description\n- Thumbnail image URL\n\nYou MUST call retrieve_product_details() with each product's ID to get:\n- Actual store links for purchasing\n- All available variants\n- Detailed reviews and ratings\n- Price comparisons across stores\n\nRecommended flow:\n1. search_products(query, filters) - Get product IDs\n2. retrieve_product_details(productId) - Get store URLs and variants for each\n3. Present results with images, prices, AND clickable store links\n\nCommon filters: limit (default 10), greaterThanPrice, lowerThanPrice, color, size, gender\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/product_search_response',\n $defs: {\n product_search_response: {\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string'\n },\n currency: {\n type: 'string'\n },\n description: {\n type: 'string'\n },\n imageUrl: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n price: {\n type: 'number'\n },\n source: {\n type: 'string'\n },\n originalPrice: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'currency',\n 'description',\n 'imageUrl',\n 'name',\n 'price',\n 'source'\n ]\n }\n },\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'data',\n 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
14
|
+
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\nSearch for products using keywords and filters (price range, color, size, gender, manufacturer, region).\n\nReturns basic product information:\n- Product ID (required for next step)\n- Name, price, currency, description\n- Thumbnail image URL\n\nYou MUST call retrieve_product_details() with each product's ID to get:\n- Actual store links for purchasing\n- All available variants\n- Detailed reviews and ratings\n- Price comparisons across stores\n\nRecommended flow:\n1. search_products(query, filters) - Get product IDs\n2. retrieve_product_details(productId) - Get store URLs and variants for each\n3. Present results with images, prices, AND clickable store links\n\nCommon filters: limit (default 10), greaterThanPrice, lowerThanPrice, color, size, gender\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/product_search_response',\n $defs: {\n product_search_response: {\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string'\n },\n currency: {\n type: 'string'\n },\n description: {\n type: 'string'\n },\n imageUrl: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n price: {\n type: 'number'\n },\n source: {\n type: 'string'\n },\n originalPrice: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'currency',\n 'description',\n 'imageUrl',\n 'name',\n 'price',\n 'source'\n ]\n }\n },\n message: {\n type: 'string'\n },\n pagination: {\n type: 'object',\n properties: {\n nextCursor: {\n type: 'string'\n },\n previousCursor: {\n type: 'string'\n }\n },\n required: [ 'nextCursor',\n 'previousCursor'\n ]\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'data',\n 'message',\n 'pagination',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
15
15
|
inputSchema: {
|
|
16
16
|
type: 'object',
|
|
17
17
|
properties: {
|
|
@@ -21,15 +21,23 @@ export const tool = {
|
|
|
21
21
|
},
|
|
22
22
|
color: {
|
|
23
23
|
type: 'string',
|
|
24
|
-
description: '
|
|
24
|
+
description: '[Deprecated] Filter results by color',
|
|
25
|
+
},
|
|
26
|
+
cursor: {
|
|
27
|
+
type: 'integer',
|
|
28
|
+
description: 'Cursor returned from the previous response (SerpAPI start param)',
|
|
29
|
+
},
|
|
30
|
+
freeShipping: {
|
|
31
|
+
type: 'boolean',
|
|
32
|
+
description: 'Restrict results to listings with free shipping',
|
|
25
33
|
},
|
|
26
34
|
gender: {
|
|
27
35
|
type: 'string',
|
|
28
|
-
description: '
|
|
36
|
+
description: '[Deprecated] Filter results by gender',
|
|
29
37
|
},
|
|
30
38
|
greaterThanPrice: {
|
|
31
39
|
type: 'number',
|
|
32
|
-
description: '
|
|
40
|
+
description: '[Deprecated] Alias for minPrice. Maintained for backwards compatibility.',
|
|
33
41
|
},
|
|
34
42
|
limit: {
|
|
35
43
|
type: 'integer',
|
|
@@ -37,19 +45,36 @@ export const tool = {
|
|
|
37
45
|
},
|
|
38
46
|
lowerThanPrice: {
|
|
39
47
|
type: 'number',
|
|
40
|
-
description: '
|
|
48
|
+
description: '[Deprecated] Alias for maxPrice. Maintained for backwards compatibility.',
|
|
41
49
|
},
|
|
42
50
|
manufacturer: {
|
|
43
51
|
type: 'string',
|
|
44
|
-
description: '
|
|
52
|
+
description: '[Deprecated] Filter results by manufacturer',
|
|
53
|
+
},
|
|
54
|
+
maxPrice: {
|
|
55
|
+
type: 'number',
|
|
56
|
+
description: 'Maximum price filter',
|
|
57
|
+
},
|
|
58
|
+
minPrice: {
|
|
59
|
+
type: 'number',
|
|
60
|
+
description: 'Minimum price filter',
|
|
45
61
|
},
|
|
46
62
|
region: {
|
|
47
63
|
type: 'string',
|
|
48
|
-
description: 'Region',
|
|
64
|
+
description: '[Deprecated] Region filter (defaults to `us`).',
|
|
49
65
|
},
|
|
50
66
|
size: {
|
|
51
67
|
type: 'string',
|
|
52
|
-
description: '
|
|
68
|
+
description: '[Deprecated] Filter results by size',
|
|
69
|
+
},
|
|
70
|
+
smallBusiness: {
|
|
71
|
+
type: 'boolean',
|
|
72
|
+
description: 'Restrict results to merchants labeled as small business',
|
|
73
|
+
},
|
|
74
|
+
sortBy: {
|
|
75
|
+
type: 'string',
|
|
76
|
+
description: 'Sort order: 1 = price low→high, 2 = price high→low',
|
|
77
|
+
enum: [1, 2],
|
|
53
78
|
},
|
|
54
79
|
jq_filter: {
|
|
55
80
|
type: 'string',
|
|
@@ -63,7 +88,15 @@ export const tool = {
|
|
|
63
88
|
};
|
|
64
89
|
export const handler = async (client, args) => {
|
|
65
90
|
const { jq_filter, ...body } = args;
|
|
66
|
-
|
|
91
|
+
try {
|
|
92
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.products.search(body)));
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
if (isJqError(error)) {
|
|
96
|
+
return asErrorResult(error.message);
|
|
97
|
+
}
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
67
100
|
};
|
|
68
101
|
export default { metadata, tool, handler };
|
|
69
102
|
//# sourceMappingURL=search-products.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-products.mjs","sourceRoot":"","sources":["../../src/tools/products/search-products.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE,MAAM,0BAA0B;
|
|
1
|
+
{"version":3,"file":"search-products.mjs","sourceRoot":"","sources":["../../src/tools/products/search-products.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC1D,EAAY,aAAa,EAAE,mBAAmB,EAAE,MAAM,4BAA4B;AAKzF,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,OAAO;IAClB,IAAI,EAA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WAAW,EAAE,qCAAqC;aACnD;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,yDAAyD;aACvE;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,oDAAoD;gBACjE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;aACb;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,OAAO,CAAC;KACpB;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,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/F,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;YACrB,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"}
|
package/tools/types.d.mts
CHANGED
|
@@ -34,6 +34,7 @@ export type ToolCallResult = {
|
|
|
34
34
|
export type HandlerFunction = (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<ToolCallResult>;
|
|
35
35
|
export declare function asTextContentResult(result: unknown): ToolCallResult;
|
|
36
36
|
export declare function asBinaryContentResult(response: Response): Promise<ToolCallResult>;
|
|
37
|
+
export declare function asErrorResult(message: string): ToolCallResult;
|
|
37
38
|
export type Metadata = {
|
|
38
39
|
resource: string;
|
|
39
40
|
operation: 'read' | 'write';
|
package/tools/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/tools/types.ts"],"names":[],"mappings":"OAEO,QAAQ,MAAM,gBAAgB;OAC9B,EAAE,IAAI,EAAE,MAAM,oCAAoC;AAEzD,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EACJ;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,GACD;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACP,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;AAE3G,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAC5B,MAAM,EAAE,QAAQ,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,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unknown> | undefined) => Promise<ToolCallResult>;
|
|
35
35
|
export declare function asTextContentResult(result: unknown): ToolCallResult;
|
|
36
36
|
export declare function asBinaryContentResult(response: Response): Promise<ToolCallResult>;
|
|
37
|
+
export declare function asErrorResult(message: string): ToolCallResult;
|
|
37
38
|
export type Metadata = {
|
|
38
39
|
resource: string;
|
|
39
40
|
operation: 'read' | 'write';
|
package/tools/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/tools/types.ts"],"names":[],"mappings":"OAEO,QAAQ,MAAM,gBAAgB;OAC9B,EAAE,IAAI,EAAE,MAAM,oCAAoC;AAEzD,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EACJ;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,GACD;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACP,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;AAE3G,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,OAA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AC;IACX,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC"}
|
package/tools/types.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.asTextContentResult = asTextContentResult;
|
|
5
5
|
exports.asBinaryContentResult = asBinaryContentResult;
|
|
6
|
+
exports.asErrorResult = asErrorResult;
|
|
6
7
|
function asTextContentResult(result) {
|
|
7
8
|
return {
|
|
8
9
|
content: [
|
|
@@ -43,4 +44,15 @@ async function asBinaryContentResult(response) {
|
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
46
|
}
|
|
47
|
+
function asErrorResult(message) {
|
|
48
|
+
return {
|
|
49
|
+
content: [
|
|
50
|
+
{
|
|
51
|
+
type: 'text',
|
|
52
|
+
text: message,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
isError: true,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
46
58
|
//# sourceMappingURL=types.js.map
|
package/tools/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/tools/types.ts"],"names":[],"mappings":";AAAA,sFAAsF;;AAiDtF,kDASC;AAED,sDA2BC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/tools/types.ts"],"names":[],"mappings":";AAAA,sFAAsF;;AAiDtF,kDASC;AAED,sDA2BC;AAED,sCAUC;AAlDD,SAAgB,mBAAmB,CAAC,MAAe;IACjD,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;aACtC;SACF;KACF,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,qBAAqB,CAAC,QAAkB;IAC5D,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;IAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACtE,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAClC,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC7C,CAAC;IACJ,CAAC;SAAM,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzC,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC7C,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,UAAU;oBAChB,QAAQ,EAAE;wBACR,uEAAuE;wBACvE,GAAG,EAAE,0BAA0B;wBAC/B,QAAQ;wBACR,IAAI,EAAE,IAAI;qBACX;iBACF;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAgB,aAAa,CAAC,OAAe;IAC3C,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,OAAO;aACd;SACF;QACD,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
package/tools/types.mjs
CHANGED
|
@@ -39,4 +39,15 @@ export async function asBinaryContentResult(response) {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
+
export function asErrorResult(message) {
|
|
43
|
+
return {
|
|
44
|
+
content: [
|
|
45
|
+
{
|
|
46
|
+
type: 'text',
|
|
47
|
+
text: message,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
isError: true,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
42
53
|
//# source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AO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,OAAO;aACd;SACF;QACD,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collect-payment-details.d.mts","sourceRoot":"","sources":["../../src/tools/wallet/collect-payment-details.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"collect-payment-details.d.mts","sourceRoot":"","sources":["../../src/tools/wallet/collect-payment-details.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,IAwBlB,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collect-payment-details.d.ts","sourceRoot":"","sources":["../../src/tools/wallet/collect-payment-details.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"collect-payment-details.d.ts","sourceRoot":"","sources":["../../src/tools/wallet/collect-payment-details.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,IAwBlB,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"}
|
|
@@ -37,7 +37,15 @@ exports.tool = {
|
|
|
37
37
|
};
|
|
38
38
|
const handler = async (client, args) => {
|
|
39
39
|
const { jq_filter, ...body } = args;
|
|
40
|
-
|
|
40
|
+
try {
|
|
41
|
+
return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.wallet.createCardCollection(body)));
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
if ((0, filtering_1.isJqError)(error)) {
|
|
45
|
+
return (0, types_1.asErrorResult)(error.message);
|
|
46
|
+
}
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
41
49
|
};
|
|
42
50
|
exports.handler = handler;
|
|
43
51
|
exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collect-payment-details.js","sourceRoot":"","sources":["../../src/tools/wallet/collect-payment-details.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"collect-payment-details.js","sourceRoot":"","sources":["../../src/tools/wallet/collect-payment-details.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAkE;AAClE,sDAA0F;AAK7E,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,QAAQ;IAClB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,sBAAsB;IAChC,WAAW,EAAE,qBAAqB;CACnC,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EACT,2iDAA2iD;IAC7iD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;aACf;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,wEAAwE;aACtF;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,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,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3G,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,IAAA,qBAAS,EAAC,KAAK,CAAC,EAAE,CAAC;YACrB,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,6 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
|
-
import { asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
2
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
3
|
+
import { asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
4
4
|
export const metadata = {
|
|
5
5
|
resource: 'wallet',
|
|
6
6
|
operation: 'write',
|
|
@@ -34,7 +34,15 @@ export const tool = {
|
|
|
34
34
|
};
|
|
35
35
|
export const handler = async (client, args) => {
|
|
36
36
|
const { jq_filter, ...body } = args;
|
|
37
|
-
|
|
37
|
+
try {
|
|
38
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.wallet.createCardCollection(body)));
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
if (isJqError(error)) {
|
|
42
|
+
return asErrorResult(error.message);
|
|
43
|
+
}
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
38
46
|
};
|
|
39
47
|
export default { metadata, tool, handler };
|
|
40
48
|
//# sourceMappingURL=collect-payment-details.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collect-payment-details.mjs","sourceRoot":"","sources":["../../src/tools/wallet/collect-payment-details.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE,MAAM,0BAA0B;
|
|
1
|
+
{"version":3,"file":"collect-payment-details.mjs","sourceRoot":"","sources":["../../src/tools/wallet/collect-payment-details.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC1D,EAAY,aAAa,EAAE,mBAAmB,EAAE,MAAM,4BAA4B;AAKzF,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,QAAQ;IAClB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,sBAAsB;IAChC,WAAW,EAAE,qBAAqB;CACnC,CAAC;AAEF,MAAM,CAA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