@henrylabs/mcp 0.14.0 → 0.17.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-types.d.mts +2 -0
- package/code-tool-types.d.mts.map +1 -1
- package/code-tool-types.d.ts +2 -0
- package/code-tool-types.d.ts.map +1 -1
- package/code-tool.d.mts +2 -2
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts +2 -2
- package/code-tool.d.ts.map +1 -1
- package/code-tool.js +27 -130
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +27 -97
- package/code-tool.mjs.map +1 -1
- package/docs-search-tool.d.mts +15 -9
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts +15 -9
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.js +4 -1
- package/docs-search-tool.js.map +1 -1
- package/docs-search-tool.mjs +4 -1
- package/docs-search-tool.mjs.map +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 +10 -66
- 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-types.ts +5 -1
- package/src/code-tool.ts +36 -121
- package/src/docs-search-tool.ts +8 -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/code-tool-paths.cjs +0 -6
- package/code-tool-paths.cjs.map +0 -1
- package/code-tool-paths.d.cts +0 -2
- package/code-tool-paths.d.cts.map +0 -1
- package/code-tool-worker.d.mts +0 -5
- package/code-tool-worker.d.mts.map +0 -1
- package/code-tool-worker.d.ts +0 -5
- package/code-tool-worker.d.ts.map +0 -1
- package/code-tool-worker.js +0 -162
- package/code-tool-worker.js.map +0 -1
- package/code-tool-worker.mjs +0 -157
- package/code-tool-worker.mjs.map +0 -1
- 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/code-tool-paths.cts +0 -3
- package/src/code-tool-worker.ts +0 -208
- 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 -56
- 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 -41
- 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 -45
- package/tools/cart/create-cart-checkout.d.mts.map +0 -1
- package/tools/cart/create-cart-checkout.d.ts +0 -45
- package/tools/cart/create-cart-checkout.d.ts.map +0 -1
- package/tools/cart/create-cart-checkout.js +0 -52
- package/tools/cart/create-cart-checkout.js.map +0 -1
- package/tools/cart/create-cart-checkout.mjs +0 -48
- package/tools/cart/create-cart-checkout.mjs.map +0 -1
- package/tools/cart/items/add-cart-items.d.mts +0 -45
- package/tools/cart/items/add-cart-items.d.mts.map +0 -1
- package/tools/cart/items/add-cart-items.d.ts +0 -45
- package/tools/cart/items/add-cart-items.d.ts.map +0 -1
- package/tools/cart/items/add-cart-items.js +0 -94
- package/tools/cart/items/add-cart-items.js.map +0 -1
- package/tools/cart/items/add-cart-items.mjs +0 -90
- package/tools/cart/items/add-cart-items.mjs.map +0 -1
- package/tools/cart/items/clear-cart-items.d.mts +0 -45
- package/tools/cart/items/clear-cart-items.d.mts.map +0 -1
- package/tools/cart/items/clear-cart-items.d.ts +0 -45
- package/tools/cart/items/clear-cart-items.d.ts.map +0 -1
- package/tools/cart/items/clear-cart-items.js +0 -50
- package/tools/cart/items/clear-cart-items.js.map +0 -1
- package/tools/cart/items/clear-cart-items.mjs +0 -46
- package/tools/cart/items/clear-cart-items.mjs.map +0 -1
- package/tools/cart/items/list-cart-items.d.mts +0 -45
- package/tools/cart/items/list-cart-items.d.mts.map +0 -1
- package/tools/cart/items/list-cart-items.d.ts +0 -45
- package/tools/cart/items/list-cart-items.d.ts.map +0 -1
- package/tools/cart/items/list-cart-items.js +0 -50
- package/tools/cart/items/list-cart-items.js.map +0 -1
- package/tools/cart/items/list-cart-items.mjs +0 -46
- package/tools/cart/items/list-cart-items.mjs.map +0 -1
- package/tools/cart/items/remove-cart-items.d.mts +0 -45
- package/tools/cart/items/remove-cart-items.d.mts.map +0 -1
- package/tools/cart/items/remove-cart-items.d.ts +0 -45
- package/tools/cart/items/remove-cart-items.d.ts.map +0 -1
- package/tools/cart/items/remove-cart-items.js +0 -53
- package/tools/cart/items/remove-cart-items.js.map +0 -1
- package/tools/cart/items/remove-cart-items.mjs +0 -49
- 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 -45
- package/tools/orders/retrieve-status-orders.d.mts.map +0 -1
- package/tools/orders/retrieve-status-orders.d.ts +0 -45
- package/tools/orders/retrieve-status-orders.d.ts.map +0 -1
- package/tools/orders/retrieve-status-orders.js +0 -50
- package/tools/orders/retrieve-status-orders.js.map +0 -1
- package/tools/orders/retrieve-status-orders.mjs +0 -46
- package/tools/orders/retrieve-status-orders.mjs.map +0 -1
- package/tools/products/retrieve-product-details.d.mts +0 -45
- package/tools/products/retrieve-product-details.d.mts.map +0 -1
- package/tools/products/retrieve-product-details.d.ts +0 -45
- package/tools/products/retrieve-product-details.d.ts.map +0 -1
- package/tools/products/retrieve-product-details.js +0 -37
- package/tools/products/retrieve-product-details.js.map +0 -1
- package/tools/products/retrieve-product-details.mjs +0 -33
- package/tools/products/retrieve-product-details.mjs.map +0 -1
- package/tools/products/search-products.d.mts +0 -45
- package/tools/products/search-products.d.mts.map +0 -1
- package/tools/products/search-products.d.ts +0 -45
- package/tools/products/search-products.d.ts.map +0 -1
- package/tools/products/search-products.js +0 -106
- package/tools/products/search-products.js.map +0 -1
- package/tools/products/search-products.mjs +0 -102
- 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 -45
- package/tools/wallet/collect-payment-details.d.mts.map +0 -1
- package/tools/wallet/collect-payment-details.d.ts +0 -45
- package/tools/wallet/collect-payment-details.d.ts.map +0 -1
- package/tools/wallet/collect-payment-details.js +0 -52
- package/tools/wallet/collect-payment-details.js.map +0 -1
- package/tools/wallet/collect-payment-details.mjs +0 -48
- 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,45 +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
|
-
[x: string]: unknown;
|
|
11
|
-
name: string;
|
|
12
|
-
inputSchema: {
|
|
13
|
-
[x: string]: unknown;
|
|
14
|
-
type: "object";
|
|
15
|
-
properties?: {
|
|
16
|
-
[x: string]: unknown;
|
|
17
|
-
} | undefined;
|
|
18
|
-
required?: string[] | undefined;
|
|
19
|
-
};
|
|
20
|
-
title?: string | undefined;
|
|
21
|
-
description?: string | undefined;
|
|
22
|
-
outputSchema?: {
|
|
23
|
-
[x: string]: unknown;
|
|
24
|
-
type: "object";
|
|
25
|
-
properties?: {
|
|
26
|
-
[x: string]: unknown;
|
|
27
|
-
} | undefined;
|
|
28
|
-
required?: string[] | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
annotations?: {
|
|
31
|
-
[x: string]: unknown;
|
|
32
|
-
title?: string | undefined;
|
|
33
|
-
readOnlyHint?: boolean | undefined;
|
|
34
|
-
destructiveHint?: boolean | undefined;
|
|
35
|
-
idempotentHint?: boolean | undefined;
|
|
36
|
-
openWorldHint?: boolean | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
_meta?: {
|
|
39
|
-
[x: string]: unknown;
|
|
40
|
-
} | undefined;
|
|
41
|
-
};
|
|
42
|
-
handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
43
|
-
};
|
|
44
|
-
export default _default;
|
|
45
|
-
//# sourceMappingURL=create-cart-checkout.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-cart-checkout.d.mts","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.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,45 +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
|
-
[x: string]: unknown;
|
|
11
|
-
name: string;
|
|
12
|
-
inputSchema: {
|
|
13
|
-
[x: string]: unknown;
|
|
14
|
-
type: "object";
|
|
15
|
-
properties?: {
|
|
16
|
-
[x: string]: unknown;
|
|
17
|
-
} | undefined;
|
|
18
|
-
required?: string[] | undefined;
|
|
19
|
-
};
|
|
20
|
-
title?: string | undefined;
|
|
21
|
-
description?: string | undefined;
|
|
22
|
-
outputSchema?: {
|
|
23
|
-
[x: string]: unknown;
|
|
24
|
-
type: "object";
|
|
25
|
-
properties?: {
|
|
26
|
-
[x: string]: unknown;
|
|
27
|
-
} | undefined;
|
|
28
|
-
required?: string[] | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
annotations?: {
|
|
31
|
-
[x: string]: unknown;
|
|
32
|
-
title?: string | undefined;
|
|
33
|
-
readOnlyHint?: boolean | undefined;
|
|
34
|
-
destructiveHint?: boolean | undefined;
|
|
35
|
-
idempotentHint?: boolean | undefined;
|
|
36
|
-
openWorldHint?: boolean | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
_meta?: {
|
|
39
|
-
[x: string]: unknown;
|
|
40
|
-
} | undefined;
|
|
41
|
-
};
|
|
42
|
-
handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
43
|
-
};
|
|
44
|
-
export default _default;
|
|
45
|
-
//# sourceMappingURL=create-cart-checkout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-cart-checkout.d.ts","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.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,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.handler = exports.tool = exports.metadata = void 0;
|
|
5
|
-
const filtering_1 = require("@henrylabs/mcp/filtering");
|
|
6
|
-
const types_1 = require("@henrylabs/mcp/tools/types");
|
|
7
|
-
exports.metadata = {
|
|
8
|
-
resource: 'cart',
|
|
9
|
-
operation: 'write',
|
|
10
|
-
tags: [],
|
|
11
|
-
httpMethod: 'post',
|
|
12
|
-
httpPath: '/cart/checkout',
|
|
13
|
-
operationId: 'createHostedCheckoutPage',
|
|
14
|
-
};
|
|
15
|
-
exports.tool = {
|
|
16
|
-
name: 'create_cart_checkout',
|
|
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\nGenerates a fully-hosted checkout URL for the user's cart. This is the SIMPLEST checkout method.\n\nThe hosted page handles:\n- Order review\n- Shipping address collection\n- Payment information (via Stripe)\n- Order confirmation\n- All UI and validation\n\nReturns: checkout_url (direct link for user to complete purchase)\n\nParameters:\n- auth: true (default) - requires user authentication, false for guest checkout\n\nUse this when:\n- You want a quick, complete checkout solution\n- Don't need custom checkout UI\n- Want Stripe to handle payment collection\n\nFor custom checkout UI, use the headless flow instead:\ncreate_checkout_session → collect_payment_details → confirm_checkout_session\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/cart_create_checkout_response',\n $defs: {\n cart_create_checkout_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 checkout_url: {\n type: 'string'\n }\n },\n required: [ 'checkout_url'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
18
|
-
inputSchema: {
|
|
19
|
-
type: 'object',
|
|
20
|
-
properties: {
|
|
21
|
-
'x-user-id': {
|
|
22
|
-
type: 'string',
|
|
23
|
-
},
|
|
24
|
-
auth: {
|
|
25
|
-
type: 'boolean',
|
|
26
|
-
description: 'Whether authentication is required for checkout (default: true)',
|
|
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
|
-
};
|
|
38
|
-
const handler = async (client, args) => {
|
|
39
|
-
const { jq_filter, ...body } = args;
|
|
40
|
-
try {
|
|
41
|
-
return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.cart.createCheckout(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
|
-
}
|
|
49
|
-
};
|
|
50
|
-
exports.handler = handler;
|
|
51
|
-
exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
|
|
52
|
-
//# sourceMappingURL=create-cart-checkout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-cart-checkout.js","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAkE;AAClE,sDAA0F;AAK7E,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,gBAAgB;IAC1B,WAAW,EAAE,0BAA0B;CACxC,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACT,6hDAA6hD;IAC/hD,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,iEAAiE;aAC/E;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,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnG,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,48 +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
|
-
export const metadata = {
|
|
5
|
-
resource: 'cart',
|
|
6
|
-
operation: 'write',
|
|
7
|
-
tags: [],
|
|
8
|
-
httpMethod: 'post',
|
|
9
|
-
httpPath: '/cart/checkout',
|
|
10
|
-
operationId: 'createHostedCheckoutPage',
|
|
11
|
-
};
|
|
12
|
-
export const tool = {
|
|
13
|
-
name: 'create_cart_checkout',
|
|
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\nGenerates a fully-hosted checkout URL for the user's cart. This is the SIMPLEST checkout method.\n\nThe hosted page handles:\n- Order review\n- Shipping address collection\n- Payment information (via Stripe)\n- Order confirmation\n- All UI and validation\n\nReturns: checkout_url (direct link for user to complete purchase)\n\nParameters:\n- auth: true (default) - requires user authentication, false for guest checkout\n\nUse this when:\n- You want a quick, complete checkout solution\n- Don't need custom checkout UI\n- Want Stripe to handle payment collection\n\nFor custom checkout UI, use the headless flow instead:\ncreate_checkout_session → collect_payment_details → confirm_checkout_session\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/cart_create_checkout_response',\n $defs: {\n cart_create_checkout_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 checkout_url: {\n type: 'string'\n }\n },\n required: [ 'checkout_url'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
15
|
-
inputSchema: {
|
|
16
|
-
type: 'object',
|
|
17
|
-
properties: {
|
|
18
|
-
'x-user-id': {
|
|
19
|
-
type: 'string',
|
|
20
|
-
},
|
|
21
|
-
auth: {
|
|
22
|
-
type: 'boolean',
|
|
23
|
-
description: 'Whether authentication is required for checkout (default: true)',
|
|
24
|
-
},
|
|
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
|
-
},
|
|
31
|
-
required: ['x-user-id'],
|
|
32
|
-
},
|
|
33
|
-
annotations: {},
|
|
34
|
-
};
|
|
35
|
-
export const handler = async (client, args) => {
|
|
36
|
-
const { jq_filter, ...body } = args;
|
|
37
|
-
try {
|
|
38
|
-
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.createCheckout(body)));
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
if (isJqError(error)) {
|
|
42
|
-
return asErrorResult(error.message);
|
|
43
|
-
}
|
|
44
|
-
throw error;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
export default { metadata, tool, handler };
|
|
48
|
-
//# sourceMappingURL=create-cart-checkout.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-cart-checkout.mjs","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.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,MAAM;IAChB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,gBAAgB;IAC1B,WAAW,EAAE,0BAA0B;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACT,6hDAA6hD;IAC/hD,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,iEAAiE;aAC/E;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;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,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnG,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"}
|
|
@@ -1,45 +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
|
-
[x: string]: unknown;
|
|
11
|
-
name: string;
|
|
12
|
-
inputSchema: {
|
|
13
|
-
[x: string]: unknown;
|
|
14
|
-
type: "object";
|
|
15
|
-
properties?: {
|
|
16
|
-
[x: string]: unknown;
|
|
17
|
-
} | undefined;
|
|
18
|
-
required?: string[] | undefined;
|
|
19
|
-
};
|
|
20
|
-
title?: string | undefined;
|
|
21
|
-
description?: string | undefined;
|
|
22
|
-
outputSchema?: {
|
|
23
|
-
[x: string]: unknown;
|
|
24
|
-
type: "object";
|
|
25
|
-
properties?: {
|
|
26
|
-
[x: string]: unknown;
|
|
27
|
-
} | undefined;
|
|
28
|
-
required?: string[] | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
annotations?: {
|
|
31
|
-
[x: string]: unknown;
|
|
32
|
-
title?: string | undefined;
|
|
33
|
-
readOnlyHint?: boolean | undefined;
|
|
34
|
-
destructiveHint?: boolean | undefined;
|
|
35
|
-
idempotentHint?: boolean | undefined;
|
|
36
|
-
openWorldHint?: boolean | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
_meta?: {
|
|
39
|
-
[x: string]: unknown;
|
|
40
|
-
} | undefined;
|
|
41
|
-
};
|
|
42
|
-
handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
43
|
-
};
|
|
44
|
-
export default _default;
|
|
45
|
-
//# sourceMappingURL=add-cart-items.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-cart-items.d.mts","sourceRoot":"","sources":["../../../src/tools/cart/items/add-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,IAoElB,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,45 +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
|
-
[x: string]: unknown;
|
|
11
|
-
name: string;
|
|
12
|
-
inputSchema: {
|
|
13
|
-
[x: string]: unknown;
|
|
14
|
-
type: "object";
|
|
15
|
-
properties?: {
|
|
16
|
-
[x: string]: unknown;
|
|
17
|
-
} | undefined;
|
|
18
|
-
required?: string[] | undefined;
|
|
19
|
-
};
|
|
20
|
-
title?: string | undefined;
|
|
21
|
-
description?: string | undefined;
|
|
22
|
-
outputSchema?: {
|
|
23
|
-
[x: string]: unknown;
|
|
24
|
-
type: "object";
|
|
25
|
-
properties?: {
|
|
26
|
-
[x: string]: unknown;
|
|
27
|
-
} | undefined;
|
|
28
|
-
required?: string[] | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
annotations?: {
|
|
31
|
-
[x: string]: unknown;
|
|
32
|
-
title?: string | undefined;
|
|
33
|
-
readOnlyHint?: boolean | undefined;
|
|
34
|
-
destructiveHint?: boolean | undefined;
|
|
35
|
-
idempotentHint?: boolean | undefined;
|
|
36
|
-
openWorldHint?: boolean | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
_meta?: {
|
|
39
|
-
[x: string]: unknown;
|
|
40
|
-
} | undefined;
|
|
41
|
-
};
|
|
42
|
-
handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
43
|
-
};
|
|
44
|
-
export default _default;
|
|
45
|
-
//# sourceMappingURL=add-cart-items.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-cart-items.d.ts","sourceRoot":"","sources":["../../../src/tools/cart/items/add-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,IAoElB,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,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.handler = exports.tool = exports.metadata = void 0;
|
|
5
|
-
const filtering_1 = require("@henrylabs/mcp/filtering");
|
|
6
|
-
const types_1 = require("@henrylabs/mcp/tools/types");
|
|
7
|
-
exports.metadata = {
|
|
8
|
-
resource: 'cart.items',
|
|
9
|
-
operation: 'write',
|
|
10
|
-
tags: [],
|
|
11
|
-
httpMethod: 'post',
|
|
12
|
-
httpPath: '/cart/items',
|
|
13
|
-
operationId: 'addCartItems',
|
|
14
|
-
};
|
|
15
|
-
exports.tool = {
|
|
16
|
-
name: 'add_cart_items',
|
|
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\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```",
|
|
18
|
-
inputSchema: {
|
|
19
|
-
type: 'object',
|
|
20
|
-
properties: {
|
|
21
|
-
productsDetails: {
|
|
22
|
-
type: 'array',
|
|
23
|
-
items: {
|
|
24
|
-
type: 'object',
|
|
25
|
-
properties: {
|
|
26
|
-
name: {
|
|
27
|
-
type: 'string',
|
|
28
|
-
description: 'Product name',
|
|
29
|
-
},
|
|
30
|
-
price: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
description: 'Product price',
|
|
33
|
-
},
|
|
34
|
-
productLink: {
|
|
35
|
-
type: 'string',
|
|
36
|
-
description: 'Product link',
|
|
37
|
-
},
|
|
38
|
-
quantity: {
|
|
39
|
-
type: 'number',
|
|
40
|
-
description: 'Quantity',
|
|
41
|
-
},
|
|
42
|
-
affiliateProductLink: {
|
|
43
|
-
type: 'string',
|
|
44
|
-
description: 'Affiliate product link (if provided, will be used instead of productLink for order fulfillment)',
|
|
45
|
-
},
|
|
46
|
-
metadata: {
|
|
47
|
-
type: 'object',
|
|
48
|
-
description: 'Product metadata',
|
|
49
|
-
additionalProperties: true,
|
|
50
|
-
},
|
|
51
|
-
productId: {
|
|
52
|
-
type: 'string',
|
|
53
|
-
description: 'Product Id',
|
|
54
|
-
},
|
|
55
|
-
productImageLink: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
description: 'Product image link (thumbnail)',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
required: ['name', 'price', 'productLink', 'quantity'],
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
'x-user-id': {
|
|
64
|
-
type: 'string',
|
|
65
|
-
},
|
|
66
|
-
checkVariantAvailability: {
|
|
67
|
-
type: 'boolean',
|
|
68
|
-
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.',
|
|
69
|
-
},
|
|
70
|
-
jq_filter: {
|
|
71
|
-
type: 'string',
|
|
72
|
-
title: 'jq Filter',
|
|
73
|
-
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/).',
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
required: ['productsDetails', 'x-user-id'],
|
|
77
|
-
},
|
|
78
|
-
annotations: {},
|
|
79
|
-
};
|
|
80
|
-
const handler = async (client, args) => {
|
|
81
|
-
const { jq_filter, ...body } = args;
|
|
82
|
-
try {
|
|
83
|
-
return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.cart.items.add(body)));
|
|
84
|
-
}
|
|
85
|
-
catch (error) {
|
|
86
|
-
if ((0, filtering_1.isJqError)(error)) {
|
|
87
|
-
return (0, types_1.asErrorResult)(error.message);
|
|
88
|
-
}
|
|
89
|
-
throw error;
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
exports.handler = handler;
|
|
93
|
-
exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
|
|
94
|
-
//# 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;AAK7E,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,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,90 +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
|
-
export const metadata = {
|
|
5
|
-
resource: 'cart.items',
|
|
6
|
-
operation: 'write',
|
|
7
|
-
tags: [],
|
|
8
|
-
httpMethod: 'post',
|
|
9
|
-
httpPath: '/cart/items',
|
|
10
|
-
operationId: 'addCartItems',
|
|
11
|
-
};
|
|
12
|
-
export const tool = {
|
|
13
|
-
name: 'add_cart_items',
|
|
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\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```",
|
|
15
|
-
inputSchema: {
|
|
16
|
-
type: 'object',
|
|
17
|
-
properties: {
|
|
18
|
-
productsDetails: {
|
|
19
|
-
type: 'array',
|
|
20
|
-
items: {
|
|
21
|
-
type: 'object',
|
|
22
|
-
properties: {
|
|
23
|
-
name: {
|
|
24
|
-
type: 'string',
|
|
25
|
-
description: 'Product name',
|
|
26
|
-
},
|
|
27
|
-
price: {
|
|
28
|
-
type: 'string',
|
|
29
|
-
description: 'Product price',
|
|
30
|
-
},
|
|
31
|
-
productLink: {
|
|
32
|
-
type: 'string',
|
|
33
|
-
description: 'Product link',
|
|
34
|
-
},
|
|
35
|
-
quantity: {
|
|
36
|
-
type: 'number',
|
|
37
|
-
description: 'Quantity',
|
|
38
|
-
},
|
|
39
|
-
affiliateProductLink: {
|
|
40
|
-
type: 'string',
|
|
41
|
-
description: 'Affiliate product link (if provided, will be used instead of productLink for order fulfillment)',
|
|
42
|
-
},
|
|
43
|
-
metadata: {
|
|
44
|
-
type: 'object',
|
|
45
|
-
description: 'Product metadata',
|
|
46
|
-
additionalProperties: true,
|
|
47
|
-
},
|
|
48
|
-
productId: {
|
|
49
|
-
type: 'string',
|
|
50
|
-
description: 'Product Id',
|
|
51
|
-
},
|
|
52
|
-
productImageLink: {
|
|
53
|
-
type: 'string',
|
|
54
|
-
description: 'Product image link (thumbnail)',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
required: ['name', 'price', 'productLink', 'quantity'],
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
'x-user-id': {
|
|
61
|
-
type: 'string',
|
|
62
|
-
},
|
|
63
|
-
checkVariantAvailability: {
|
|
64
|
-
type: 'boolean',
|
|
65
|
-
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.',
|
|
66
|
-
},
|
|
67
|
-
jq_filter: {
|
|
68
|
-
type: 'string',
|
|
69
|
-
title: 'jq Filter',
|
|
70
|
-
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/).',
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
required: ['productsDetails', 'x-user-id'],
|
|
74
|
-
},
|
|
75
|
-
annotations: {},
|
|
76
|
-
};
|
|
77
|
-
export const handler = async (client, args) => {
|
|
78
|
-
const { jq_filter, ...body } = args;
|
|
79
|
-
try {
|
|
80
|
-
return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.add(body)));
|
|
81
|
-
}
|
|
82
|
-
catch (error) {
|
|
83
|
-
if (isJqError(error)) {
|
|
84
|
-
return asErrorResult(error.message);
|
|
85
|
-
}
|
|
86
|
-
throw error;
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
export default { metadata, tool, handler };
|
|
90
|
-
//# 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;AAKzF,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,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"}
|
|
@@ -1,45 +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
|
-
[x: string]: unknown;
|
|
11
|
-
name: string;
|
|
12
|
-
inputSchema: {
|
|
13
|
-
[x: string]: unknown;
|
|
14
|
-
type: "object";
|
|
15
|
-
properties?: {
|
|
16
|
-
[x: string]: unknown;
|
|
17
|
-
} | undefined;
|
|
18
|
-
required?: string[] | undefined;
|
|
19
|
-
};
|
|
20
|
-
title?: string | undefined;
|
|
21
|
-
description?: string | undefined;
|
|
22
|
-
outputSchema?: {
|
|
23
|
-
[x: string]: unknown;
|
|
24
|
-
type: "object";
|
|
25
|
-
properties?: {
|
|
26
|
-
[x: string]: unknown;
|
|
27
|
-
} | undefined;
|
|
28
|
-
required?: string[] | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
annotations?: {
|
|
31
|
-
[x: string]: unknown;
|
|
32
|
-
title?: string | undefined;
|
|
33
|
-
readOnlyHint?: boolean | undefined;
|
|
34
|
-
destructiveHint?: boolean | undefined;
|
|
35
|
-
idempotentHint?: boolean | undefined;
|
|
36
|
-
openWorldHint?: boolean | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
_meta?: {
|
|
39
|
-
[x: string]: unknown;
|
|
40
|
-
} | undefined;
|
|
41
|
-
};
|
|
42
|
-
handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
43
|
-
};
|
|
44
|
-
export default _default;
|
|
45
|
-
//# 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,45 +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
|
-
[x: string]: unknown;
|
|
11
|
-
name: string;
|
|
12
|
-
inputSchema: {
|
|
13
|
-
[x: string]: unknown;
|
|
14
|
-
type: "object";
|
|
15
|
-
properties?: {
|
|
16
|
-
[x: string]: unknown;
|
|
17
|
-
} | undefined;
|
|
18
|
-
required?: string[] | undefined;
|
|
19
|
-
};
|
|
20
|
-
title?: string | undefined;
|
|
21
|
-
description?: string | undefined;
|
|
22
|
-
outputSchema?: {
|
|
23
|
-
[x: string]: unknown;
|
|
24
|
-
type: "object";
|
|
25
|
-
properties?: {
|
|
26
|
-
[x: string]: unknown;
|
|
27
|
-
} | undefined;
|
|
28
|
-
required?: string[] | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
annotations?: {
|
|
31
|
-
[x: string]: unknown;
|
|
32
|
-
title?: string | undefined;
|
|
33
|
-
readOnlyHint?: boolean | undefined;
|
|
34
|
-
destructiveHint?: boolean | undefined;
|
|
35
|
-
idempotentHint?: boolean | undefined;
|
|
36
|
-
openWorldHint?: boolean | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
_meta?: {
|
|
39
|
-
[x: string]: unknown;
|
|
40
|
-
} | undefined;
|
|
41
|
-
};
|
|
42
|
-
handler: (client: HenrySDK, args: Record<string, unknown> | undefined) => Promise<import("@henrylabs/mcp/tools/types").ToolCallResult>;
|
|
43
|
-
};
|
|
44
|
-
export default _default;
|
|
45
|
-
//# 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"}
|