@henrylabs/mcp 0.10.0 → 0.12.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 +11 -11
- 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 +11 -4
- package/src/tools/cart/items/add-cart-items.ts +11 -4
- package/src/tools/cart/items/clear-cart-items.ts +11 -4
- package/src/tools/cart/items/list-cart-items.ts +11 -4
- package/src/tools/cart/items/remove-cart-items.ts +11 -4
- package/src/tools/checkout/session/confirm-checkout-session.ts +13 -6
- package/src/tools/checkout/session/create-checkout-session.ts +11 -4
- package/src/tools/orders/retrieve-status-orders.ts +11 -4
- package/src/tools/products/retrieve-product-details.ts +4 -11
- package/src/tools/products/search-products.ts +44 -12
- package/src/tools/types.ts +12 -0
- package/src/tools/wallet/collect-payment-details.ts +11 -4
- 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 +10 -2
- package/tools/cart/create-cart-checkout.js.map +1 -1
- package/tools/cart/create-cart-checkout.mjs +12 -4
- 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 +10 -2
- package/tools/cart/items/add-cart-items.js.map +1 -1
- package/tools/cart/items/add-cart-items.mjs +12 -4
- 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 +10 -2
- package/tools/cart/items/clear-cart-items.js.map +1 -1
- package/tools/cart/items/clear-cart-items.mjs +12 -4
- 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 +10 -2
- package/tools/cart/items/list-cart-items.js.map +1 -1
- package/tools/cart/items/list-cart-items.mjs +12 -4
- 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 +10 -2
- package/tools/cart/items/remove-cart-items.js.map +1 -1
- package/tools/cart/items/remove-cart-items.mjs +12 -4
- 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 +10 -2
- package/tools/checkout/session/confirm-checkout-session.js.map +1 -1
- package/tools/checkout/session/confirm-checkout-session.mjs +12 -4
- 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 +10 -2
- package/tools/checkout/session/create-checkout-session.js.map +1 -1
- package/tools/checkout/session/create-checkout-session.mjs +12 -4
- 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 +10 -2
- package/tools/orders/retrieve-status-orders.js.map +1 -1
- package/tools/orders/retrieve-status-orders.mjs +12 -4
- 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 +4 -10
- package/tools/products/retrieve-product-details.js.map +1 -1
- package/tools/products/retrieve-product-details.mjs +4 -10
- 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 +43 -10
- package/tools/products/search-products.js.map +1 -1
- package/tools/products/search-products.mjs +45 -12
- 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 +10 -2
- package/tools/wallet/collect-payment-details.js.map +1 -1
- package/tools/wallet/collect-payment-details.mjs +12 -4
- package/tools/wallet/collect-payment-details.mjs.map +1 -1
package/README.md
CHANGED
|
@@ -241,7 +241,7 @@ The following tools are available in this MCP server.
|
|
|
241
241
|
|
|
242
242
|
### Resource `products`:
|
|
243
243
|
|
|
244
|
-
- `retrieve_product_details` (`read`)
|
|
244
|
+
- `retrieve_product_details` (`read`): Retrieve comprehensive product details using a product ID from search results.
|
|
245
245
|
|
|
246
246
|
MUST BE CALLED BEFORE adding items to cart - this is the only way to get the productLink required for cart operations.
|
|
247
247
|
|
|
@@ -252,7 +252,7 @@ The following tools are available in this MCP server.
|
|
|
252
252
|
- Available variants (sizes, colors, etc.) with availability status
|
|
253
253
|
- Thumbnail images (multiple angles)
|
|
254
254
|
|
|
255
|
-
- `search_products` (`write`)
|
|
255
|
+
- `search_products` (`write`): Search for products using keywords and filters (price range, color, size, gender, manufacturer, region).
|
|
256
256
|
|
|
257
257
|
Returns basic product information:
|
|
258
258
|
|
|
@@ -277,7 +277,7 @@ The following tools are available in this MCP server.
|
|
|
277
277
|
|
|
278
278
|
### Resource `cart`:
|
|
279
279
|
|
|
280
|
-
- `create_cart_checkout` (`write`)
|
|
280
|
+
- `create_cart_checkout` (`write`): Generates a fully-hosted checkout URL for the user's cart. This is the SIMPLEST checkout method.
|
|
281
281
|
|
|
282
282
|
The hosted page handles:
|
|
283
283
|
|
|
@@ -304,7 +304,7 @@ The following tools are available in this MCP server.
|
|
|
304
304
|
|
|
305
305
|
### Resource `cart.items`:
|
|
306
306
|
|
|
307
|
-
- `list_cart_items` (`read`) tags: [
|
|
307
|
+
- `list_cart_items` (`read`) tags: [hosted]: Retrieve all products currently in the user's cart.
|
|
308
308
|
|
|
309
309
|
Returns products array with:
|
|
310
310
|
|
|
@@ -320,7 +320,7 @@ The following tools are available in this MCP server.
|
|
|
320
320
|
- Calculate totals
|
|
321
321
|
- Verify items before creating checkout
|
|
322
322
|
|
|
323
|
-
- `add_cart_items` (`write`) tags: [
|
|
323
|
+
- `add_cart_items` (`write`) tags: [hosted]: Add products to cart or update quantities if already in cart.
|
|
324
324
|
|
|
325
325
|
Required fields per product:
|
|
326
326
|
|
|
@@ -353,7 +353,7 @@ The following tools are available in this MCP server.
|
|
|
353
353
|
- cart_summary: total_items and total_unique_products
|
|
354
354
|
- variant_checks: Availability verification results (if requested)
|
|
355
355
|
|
|
356
|
-
- `clear_cart_items` (`write`) tags: [
|
|
356
|
+
- `clear_cart_items` (`write`) tags: [hosted]: Remove ALL products from the cart. Cannot be undone.
|
|
357
357
|
|
|
358
358
|
Use when:
|
|
359
359
|
|
|
@@ -363,7 +363,7 @@ The following tools are available in this MCP server.
|
|
|
363
363
|
|
|
364
364
|
Returns success confirmation message.
|
|
365
365
|
|
|
366
|
-
- `remove_cart_items` (`write`) tags: [
|
|
366
|
+
- `remove_cart_items` (`write`) tags: [hosted]: Remove a specific product from the cart by its productId.
|
|
367
367
|
|
|
368
368
|
Required: productId (must match the ID used when adding item)
|
|
369
369
|
|
|
@@ -371,7 +371,7 @@ The following tools are available in this MCP server.
|
|
|
371
371
|
|
|
372
372
|
### Resource `checkout.session`:
|
|
373
373
|
|
|
374
|
-
- `confirm_checkout_session` (`write`)
|
|
374
|
+
- `confirm_checkout_session` (`write`): Finalize the checkout and create an order. Returns order details with order ID.
|
|
375
375
|
|
|
376
376
|
Required:
|
|
377
377
|
|
|
@@ -392,7 +392,7 @@ The following tools are available in this MCP server.
|
|
|
392
392
|
|
|
393
393
|
After confirmation, provide order ID to user for tracking.
|
|
394
394
|
|
|
395
|
-
- `create_checkout_session` (`write`)
|
|
395
|
+
- `create_checkout_session` (`write`): Create/update a checkout session for headless checkout flow. Returns pricing breakdown and session token.
|
|
396
396
|
|
|
397
397
|
Required: shippingDetails object with:
|
|
398
398
|
|
|
@@ -417,7 +417,7 @@ The following tools are available in this MCP server.
|
|
|
417
417
|
|
|
418
418
|
### Resource `orders`:
|
|
419
419
|
|
|
420
|
-
- `retrieve_status_orders` (`read`)
|
|
420
|
+
- `retrieve_status_orders` (`read`): Check the status and details of an order using its order ID.
|
|
421
421
|
|
|
422
422
|
Returns:
|
|
423
423
|
|
|
@@ -439,7 +439,7 @@ The following tools are available in this MCP server.
|
|
|
439
439
|
|
|
440
440
|
### Resource `wallet`:
|
|
441
441
|
|
|
442
|
-
- `collect_payment_details` (`write`)
|
|
442
|
+
- `collect_payment_details` (`write`): Generate a modal URL for securely collecting payment card information via Stripe.
|
|
443
443
|
|
|
444
444
|
MUST be called in headless checkout flow BEFORE confirm_checkout_session.
|
|
445
445
|
|
package/filtering.d.mts
CHANGED
package/filtering.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filtering.d.mts","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAM5F"}
|
|
1
|
+
{"version":3,"file":"filtering.d.mts","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAM5F;AAMD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAEpD"}
|
package/filtering.d.ts
CHANGED
package/filtering.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filtering.d.ts","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAM5F"}
|
|
1
|
+
{"version":3,"file":"filtering.d.ts","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAM5F;AAMD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAEpD"}
|
package/filtering.js
CHANGED
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.maybeFilter = maybeFilter;
|
|
7
|
+
exports.isJqError = isJqError;
|
|
7
8
|
// @ts-nocheck
|
|
8
9
|
const jq_web_1 = __importDefault(require("jq-web"));
|
|
9
10
|
async function maybeFilter(jqFilter, response) {
|
|
@@ -17,4 +18,7 @@ async function maybeFilter(jqFilter, response) {
|
|
|
17
18
|
async function jq(json, jqFilter) {
|
|
18
19
|
return (await jq_web_1.default).json(json, jqFilter);
|
|
19
20
|
}
|
|
21
|
+
function isJqError(error) {
|
|
22
|
+
return error instanceof Error && 'stderr' in error;
|
|
23
|
+
}
|
|
20
24
|
//# sourceMappingURL=filtering.js.map
|
package/filtering.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filtering.js","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":";;;;;AAGA,kCAMC;
|
|
1
|
+
{"version":3,"file":"filtering.js","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":";;;;;AAGA,kCAMC;AAMD,8BAEC;AAjBD,cAAc;AACd,oDAA4B;AAErB,KAAK,UAAU,WAAW,CAAC,QAA6B,EAAE,QAAa;IAC5E,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC7C,OAAO,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC,IAAS,EAAE,QAAgB;IAC3C,OAAO,CAAC,MAAM,gBAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAED,SAAgB,SAAS,CAAC,KAAU;IAClC,OAAO,KAAK,YAAY,KAAK,IAAI,QAAQ,IAAI,KAAK,CAAC;AACrD,CAAC"}
|
package/filtering.mjs
CHANGED
|
@@ -10,4 +10,7 @@ export async function maybeFilter(jqFilter, response) {
|
|
|
10
10
|
async function jq(json, jqFilter) {
|
|
11
11
|
return (await initJq).json(json, jqFilter);
|
|
12
12
|
}
|
|
13
|
+
export function isJqError(error) {
|
|
14
|
+
return error instanceof Error && 'stderr' in error;
|
|
15
|
+
}
|
|
13
16
|
//# sourceMappingURL=filtering.mjs.map
|
package/filtering.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filtering.mjs","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"OACO,MAAM,MAAM,QAAQ;AAE3B,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAA6B,EAAE,QAAa;IAC5E,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC7C,OAAO,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC,IAAS,EAAE,QAAgB;IAC3C,OAAO,CAAC,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC"}
|
|
1
|
+
{"version":3,"file":"filtering.mjs","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"OACO,MAAM,MAAM,QAAQ;AAE3B,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAA6B,EAAE,QAAa;IAC5E,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC7C,OAAO,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC,IAAS,EAAE,QAAgB;IAC3C,OAAO,CAAC,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAU;IAClC,OAAO,KAAK,YAAY,KAAK,IAAI,QAAQ,IAAI,KAAK,CAAC;AACrD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@henrylabs/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "The official MCP Server for the Henry SDK API",
|
|
5
5
|
"author": "Henry SDK <lawrence@henry.social>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"fix": "eslint --fix --ext ts,js ."
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@henrylabs/sdk": "^0.
|
|
30
|
+
"@henrylabs/sdk": "^0.12.0",
|
|
31
31
|
"@cloudflare/cabidela": "^0.2.4",
|
|
32
32
|
"@modelcontextprotocol/sdk": "^1.11.5",
|
|
33
33
|
"@valtown/deno-http-worker": "^0.0.21",
|
|
34
34
|
"cors": "^2.8.5",
|
|
35
35
|
"express": "^5.1.0",
|
|
36
36
|
"fuse.js": "^7.1.0",
|
|
37
|
-
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.
|
|
37
|
+
"jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.8/jq-web.tar.gz",
|
|
38
38
|
"qs": "^6.14.0",
|
|
39
39
|
"typescript": "5.8.3",
|
|
40
40
|
"yargs": "^17.7.2",
|
package/server.js
CHANGED
|
@@ -22,7 +22,7 @@ var tools_2 = require("./tools.js");
|
|
|
22
22
|
Object.defineProperty(exports, "endpoints", { enumerable: true, get: function () { return tools_2.endpoints; } });
|
|
23
23
|
const newMcpServer = () => new mcp_js_1.McpServer({
|
|
24
24
|
name: 'henrylabs_sdk_api',
|
|
25
|
-
version: '0.
|
|
25
|
+
version: '0.12.0',
|
|
26
26
|
}, { capabilities: { tools: {}, logging: {} } });
|
|
27
27
|
exports.newMcpServer = newMcpServer;
|
|
28
28
|
// Create server instance
|
package/server.mjs
CHANGED
|
@@ -11,7 +11,7 @@ export { ClientType } from "./compat.mjs";
|
|
|
11
11
|
export { endpoints } from "./tools.mjs";
|
|
12
12
|
export const newMcpServer = () => new McpServer({
|
|
13
13
|
name: 'henrylabs_sdk_api',
|
|
14
|
-
version: '0.
|
|
14
|
+
version: '0.12.0',
|
|
15
15
|
}, { capabilities: { tools: {}, logging: {} } });
|
|
16
16
|
// Create server instance
|
|
17
17
|
export const server = newMcpServer();
|
package/src/filtering.ts
CHANGED
|
@@ -12,3 +12,7 @@ export async function maybeFilter(jqFilter: unknown | undefined, response: any):
|
|
|
12
12
|
async function jq(json: any, jqFilter: string) {
|
|
13
13
|
return (await initJq).json(json, jqFilter);
|
|
14
14
|
}
|
|
15
|
+
|
|
16
|
+
export function isJqError(error: any): error is Error {
|
|
17
|
+
return error instanceof Error && 'stderr' in error;
|
|
18
|
+
}
|
package/src/server.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import HenrySDK from '@henrylabs/sdk';
|
|
@@ -9,7 +9,7 @@ import HenrySDK from '@henrylabs/sdk';
|
|
|
9
9
|
export const metadata: Metadata = {
|
|
10
10
|
resource: 'cart',
|
|
11
11
|
operation: 'write',
|
|
12
|
-
tags: [
|
|
12
|
+
tags: [],
|
|
13
13
|
httpMethod: 'post',
|
|
14
14
|
httpPath: '/cart/checkout',
|
|
15
15
|
operationId: 'createHostedCheckoutPage',
|
|
@@ -43,7 +43,14 @@ export const tool: Tool = {
|
|
|
43
43
|
|
|
44
44
|
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
45
45
|
const { jq_filter, ...body } = args as any;
|
|
46
|
-
|
|
46
|
+
try {
|
|
47
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.createCheckout(body)));
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if (isJqError(error)) {
|
|
50
|
+
return asErrorResult(error.message);
|
|
51
|
+
}
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
47
54
|
};
|
|
48
55
|
|
|
49
56
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import HenrySDK from '@henrylabs/sdk';
|
|
@@ -9,7 +9,7 @@ import HenrySDK from '@henrylabs/sdk';
|
|
|
9
9
|
export const metadata: Metadata = {
|
|
10
10
|
resource: 'cart.items',
|
|
11
11
|
operation: 'write',
|
|
12
|
-
tags: ['
|
|
12
|
+
tags: ['hosted'],
|
|
13
13
|
httpMethod: 'post',
|
|
14
14
|
httpPath: '/cart/items',
|
|
15
15
|
operationId: 'addCartItems',
|
|
@@ -87,7 +87,14 @@ export const tool: Tool = {
|
|
|
87
87
|
|
|
88
88
|
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
89
89
|
const { jq_filter, ...body } = args as any;
|
|
90
|
-
|
|
90
|
+
try {
|
|
91
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.add(body)));
|
|
92
|
+
} catch (error) {
|
|
93
|
+
if (isJqError(error)) {
|
|
94
|
+
return asErrorResult(error.message);
|
|
95
|
+
}
|
|
96
|
+
throw error;
|
|
97
|
+
}
|
|
91
98
|
};
|
|
92
99
|
|
|
93
100
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import HenrySDK from '@henrylabs/sdk';
|
|
@@ -9,7 +9,7 @@ import HenrySDK from '@henrylabs/sdk';
|
|
|
9
9
|
export const metadata: Metadata = {
|
|
10
10
|
resource: 'cart.items',
|
|
11
11
|
operation: 'write',
|
|
12
|
-
tags: ['
|
|
12
|
+
tags: ['hosted'],
|
|
13
13
|
httpMethod: 'delete',
|
|
14
14
|
httpPath: '/cart/items',
|
|
15
15
|
operationId: 'deleteAllCartItems',
|
|
@@ -41,7 +41,14 @@ export const tool: Tool = {
|
|
|
41
41
|
|
|
42
42
|
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
43
43
|
const { jq_filter, ...body } = args as any;
|
|
44
|
-
|
|
44
|
+
try {
|
|
45
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.clear(body)));
|
|
46
|
+
} catch (error) {
|
|
47
|
+
if (isJqError(error)) {
|
|
48
|
+
return asErrorResult(error.message);
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
45
52
|
};
|
|
46
53
|
|
|
47
54
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import HenrySDK from '@henrylabs/sdk';
|
|
@@ -9,7 +9,7 @@ import HenrySDK from '@henrylabs/sdk';
|
|
|
9
9
|
export const metadata: Metadata = {
|
|
10
10
|
resource: 'cart.items',
|
|
11
11
|
operation: 'read',
|
|
12
|
-
tags: ['
|
|
12
|
+
tags: ['hosted'],
|
|
13
13
|
httpMethod: 'get',
|
|
14
14
|
httpPath: '/cart/items',
|
|
15
15
|
operationId: 'getCartItems',
|
|
@@ -41,7 +41,14 @@ export const tool: Tool = {
|
|
|
41
41
|
|
|
42
42
|
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
43
43
|
const { jq_filter, ...body } = args as any;
|
|
44
|
-
|
|
44
|
+
try {
|
|
45
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.list(body)));
|
|
46
|
+
} catch (error) {
|
|
47
|
+
if (isJqError(error)) {
|
|
48
|
+
return asErrorResult(error.message);
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
45
52
|
};
|
|
46
53
|
|
|
47
54
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import HenrySDK from '@henrylabs/sdk';
|
|
@@ -9,7 +9,7 @@ import HenrySDK from '@henrylabs/sdk';
|
|
|
9
9
|
export const metadata: Metadata = {
|
|
10
10
|
resource: 'cart.items',
|
|
11
11
|
operation: 'write',
|
|
12
|
-
tags: ['
|
|
12
|
+
tags: ['hosted'],
|
|
13
13
|
httpMethod: 'delete',
|
|
14
14
|
httpPath: '/cart/items/{productId}',
|
|
15
15
|
operationId: 'deleteCartItem',
|
|
@@ -44,7 +44,14 @@ export const tool: Tool = {
|
|
|
44
44
|
|
|
45
45
|
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
46
46
|
const { productId, jq_filter, ...body } = args as any;
|
|
47
|
-
|
|
47
|
+
try {
|
|
48
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.remove(productId, body)));
|
|
49
|
+
} catch (error) {
|
|
50
|
+
if (isJqError(error)) {
|
|
51
|
+
return asErrorResult(error.message);
|
|
52
|
+
}
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
48
55
|
};
|
|
49
56
|
|
|
50
57
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import HenrySDK from '@henrylabs/sdk';
|
|
@@ -9,7 +9,7 @@ import HenrySDK from '@henrylabs/sdk';
|
|
|
9
9
|
export const metadata: Metadata = {
|
|
10
10
|
resource: 'checkout.session',
|
|
11
11
|
operation: 'write',
|
|
12
|
-
tags: [
|
|
12
|
+
tags: [],
|
|
13
13
|
httpMethod: 'post',
|
|
14
14
|
httpPath: '/checkout/session/confirm',
|
|
15
15
|
operationId: 'confirmCheckoutSession',
|
|
@@ -93,9 +93,16 @@ export const tool: Tool = {
|
|
|
93
93
|
|
|
94
94
|
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
95
95
|
const { jq_filter, ...body } = args as any;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
try {
|
|
97
|
+
return asTextContentResult(
|
|
98
|
+
await maybeFilter(jq_filter, await client.checkout.session.confirmCheckout(body)),
|
|
99
|
+
);
|
|
100
|
+
} catch (error) {
|
|
101
|
+
if (isJqError(error)) {
|
|
102
|
+
return asErrorResult(error.message);
|
|
103
|
+
}
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
99
106
|
};
|
|
100
107
|
|
|
101
108
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import HenrySDK from '@henrylabs/sdk';
|
|
@@ -9,7 +9,7 @@ import HenrySDK from '@henrylabs/sdk';
|
|
|
9
9
|
export const metadata: Metadata = {
|
|
10
10
|
resource: 'checkout.session',
|
|
11
11
|
operation: 'write',
|
|
12
|
-
tags: [
|
|
12
|
+
tags: [],
|
|
13
13
|
httpMethod: 'post',
|
|
14
14
|
httpPath: '/checkout/session/quote',
|
|
15
15
|
operationId: 'createCheckoutSessionQuote',
|
|
@@ -90,7 +90,14 @@ export const tool: Tool = {
|
|
|
90
90
|
|
|
91
91
|
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
92
92
|
const { jq_filter, ...body } = args as any;
|
|
93
|
-
|
|
93
|
+
try {
|
|
94
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.checkout.session.createQuote(body)));
|
|
95
|
+
} catch (error) {
|
|
96
|
+
if (isJqError(error)) {
|
|
97
|
+
return asErrorResult(error.message);
|
|
98
|
+
}
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
94
101
|
};
|
|
95
102
|
|
|
96
103
|
export default { metadata, tool, handler };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
-
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
3
|
+
import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
5
|
|
|
6
6
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
7
|
import HenrySDK from '@henrylabs/sdk';
|
|
@@ -9,7 +9,7 @@ import HenrySDK from '@henrylabs/sdk';
|
|
|
9
9
|
export const metadata: Metadata = {
|
|
10
10
|
resource: 'orders',
|
|
11
11
|
operation: 'read',
|
|
12
|
-
tags: [
|
|
12
|
+
tags: [],
|
|
13
13
|
httpMethod: 'get',
|
|
14
14
|
httpPath: '/orders/{orderId}',
|
|
15
15
|
operationId: 'getOrderStatus',
|
|
@@ -41,7 +41,14 @@ export const tool: Tool = {
|
|
|
41
41
|
|
|
42
42
|
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
43
43
|
const { orderId, jq_filter, ...body } = args as any;
|
|
44
|
-
|
|
44
|
+
try {
|
|
45
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.orders.retrieveStatus(orderId)));
|
|
46
|
+
} catch (error) {
|
|
47
|
+
if (isJqError(error)) {
|
|
48
|
+
return asErrorResult(error.message);
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
45
52
|
};
|
|
46
53
|
|
|
47
54
|
export default { metadata, tool, handler };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
3
|
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
4
|
|
|
6
5
|
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
@@ -9,7 +8,7 @@ import HenrySDK from '@henrylabs/sdk';
|
|
|
9
8
|
export const metadata: Metadata = {
|
|
10
9
|
resource: 'products',
|
|
11
10
|
operation: 'read',
|
|
12
|
-
tags: [
|
|
11
|
+
tags: [],
|
|
13
12
|
httpMethod: 'get',
|
|
14
13
|
httpPath: '/products/details',
|
|
15
14
|
operationId: 'getProductDetails',
|
|
@@ -18,7 +17,7 @@ export const metadata: Metadata = {
|
|
|
18
17
|
export const tool: Tool = {
|
|
19
18
|
name: 'retrieve_product_details',
|
|
20
19
|
description:
|
|
21
|
-
|
|
20
|
+
'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',
|
|
22
21
|
inputSchema: {
|
|
23
22
|
type: 'object',
|
|
24
23
|
properties: {
|
|
@@ -26,12 +25,6 @@ export const tool: Tool = {
|
|
|
26
25
|
type: 'string',
|
|
27
26
|
description: 'Product ID',
|
|
28
27
|
},
|
|
29
|
-
jq_filter: {
|
|
30
|
-
type: 'string',
|
|
31
|
-
title: 'jq Filter',
|
|
32
|
-
description:
|
|
33
|
-
'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/).',
|
|
34
|
-
},
|
|
35
28
|
},
|
|
36
29
|
required: ['productId'],
|
|
37
30
|
},
|
|
@@ -41,8 +34,8 @@ export const tool: Tool = {
|
|
|
41
34
|
};
|
|
42
35
|
|
|
43
36
|
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
44
|
-
const
|
|
45
|
-
return asTextContentResult(await
|
|
37
|
+
const body = args as any;
|
|
38
|
+
return asTextContentResult(await client.products.retrieveDetails(body));
|
|
46
39
|
};
|
|
47
40
|
|
|
48
41
|
export default { metadata, tool, handler };
|