@henrylabs/mcp 0.2.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/LICENSE +201 -0
- package/README.md +255 -0
- package/code-tool-paths.cjs +6 -0
- package/code-tool-paths.cjs.map +1 -0
- package/code-tool-paths.d.cts +2 -0
- package/code-tool-paths.d.cts.map +1 -0
- package/code-tool-types.d.mts +14 -0
- package/code-tool-types.d.mts.map +1 -0
- package/code-tool-types.d.ts +14 -0
- package/code-tool-types.d.ts.map +1 -0
- package/code-tool-types.js +4 -0
- package/code-tool-types.js.map +1 -0
- package/code-tool-types.mjs +3 -0
- package/code-tool-types.mjs.map +1 -0
- package/code-tool-worker.d.mts +5 -0
- package/code-tool-worker.d.mts.map +1 -0
- package/code-tool-worker.d.ts +5 -0
- package/code-tool-worker.d.ts.map +1 -0
- package/code-tool-worker.js +45 -0
- package/code-tool-worker.js.map +1 -0
- package/code-tool-worker.mjs +40 -0
- package/code-tool-worker.mjs.map +1 -0
- package/code-tool.d.mts +12 -0
- package/code-tool.d.mts.map +1 -0
- package/code-tool.d.ts +12 -0
- package/code-tool.d.ts.map +1 -0
- package/code-tool.js +158 -0
- package/code-tool.js.map +1 -0
- package/code-tool.mjs +122 -0
- package/code-tool.mjs.map +1 -0
- package/compat.d.mts +58 -0
- package/compat.d.mts.map +1 -0
- package/compat.d.ts +58 -0
- package/compat.d.ts.map +1 -0
- package/compat.js +387 -0
- package/compat.js.map +1 -0
- package/compat.mjs +378 -0
- package/compat.mjs.map +1 -0
- package/docs-search-tool.d.mts +44 -0
- package/docs-search-tool.d.mts.map +1 -0
- package/docs-search-tool.d.ts +44 -0
- package/docs-search-tool.d.ts.map +1 -0
- package/docs-search-tool.js +43 -0
- package/docs-search-tool.js.map +1 -0
- package/docs-search-tool.mjs +39 -0
- package/docs-search-tool.mjs.map +1 -0
- package/dynamic-tools.d.mts +12 -0
- package/dynamic-tools.d.mts.map +1 -0
- package/dynamic-tools.d.ts +12 -0
- package/dynamic-tools.d.ts.map +1 -0
- package/dynamic-tools.js +135 -0
- package/dynamic-tools.js.map +1 -0
- package/dynamic-tools.mjs +132 -0
- package/dynamic-tools.mjs.map +1 -0
- package/filtering.d.mts +2 -0
- package/filtering.d.mts.map +1 -0
- package/filtering.d.ts +2 -0
- package/filtering.d.ts.map +1 -0
- package/filtering.js +20 -0
- package/filtering.js.map +1 -0
- package/filtering.mjs +13 -0
- package/filtering.mjs.map +1 -0
- package/headers.d.mts +4 -0
- package/headers.d.mts.map +1 -0
- package/headers.d.ts +4 -0
- package/headers.d.ts.map +1 -0
- package/headers.js +13 -0
- package/headers.js.map +1 -0
- package/headers.mjs +9 -0
- package/headers.mjs.map +1 -0
- package/http.d.mts +9 -0
- package/http.d.mts.map +1 -0
- package/http.d.ts +9 -0
- package/http.d.ts.map +1 -0
- package/http.js +108 -0
- package/http.js.map +1 -0
- package/http.mjs +100 -0
- package/http.mjs.map +1 -0
- package/index.d.mts +3 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +91 -0
- package/index.js.map +1 -0
- package/index.mjs +89 -0
- package/index.mjs.map +1 -0
- package/options.d.mts +20 -0
- package/options.d.mts.map +1 -0
- package/options.d.ts +20 -0
- package/options.d.ts.map +1 -0
- package/options.js +424 -0
- package/options.js.map +1 -0
- package/options.mjs +417 -0
- package/options.mjs.map +1 -0
- package/package.json +216 -0
- package/server.d.mts +35 -0
- package/server.d.mts.map +1 -0
- package/server.d.ts +35 -0
- package/server.d.ts.map +1 -0
- package/server.js +175 -0
- package/server.js.map +1 -0
- package/server.mjs +161 -0
- package/server.mjs.map +1 -0
- package/src/code-tool-paths.cts +3 -0
- package/src/code-tool-types.ts +14 -0
- package/src/code-tool-worker.ts +46 -0
- package/src/code-tool.ts +147 -0
- package/src/compat.ts +483 -0
- package/src/docs-search-tool.ts +48 -0
- package/src/dynamic-tools.ts +153 -0
- package/src/filtering.ts +14 -0
- package/src/headers.ts +14 -0
- package/src/http.ts +127 -0
- package/src/index.ts +108 -0
- package/src/options.ts +466 -0
- package/src/server.ts +208 -0
- package/src/stdio.ts +13 -0
- package/src/tools/cart/create-checkout-cart.ts +49 -0
- package/src/tools/cart/items/add-cart-items.ts +93 -0
- package/src/tools/cart/items/clear-cart-items.ts +47 -0
- package/src/tools/cart/items/list-cart-items.ts +47 -0
- package/src/tools/cart/items/remove-cart-items.ts +50 -0
- package/src/tools/checkout/session/confirm-checkout-checkout-session.ts +101 -0
- package/src/tools/checkout/session/create-quote-checkout-session.ts +96 -0
- package/src/tools/checkout/session/list-products-checkout-session.ts +47 -0
- package/src/tools/checkout/session/retrieve-shipping-info-checkout-session.ts +49 -0
- package/src/tools/index.ts +105 -0
- package/src/tools/merchants/check-status-merchants.ts +56 -0
- package/src/tools/merchants/get-shipping-info-merchants.ts +60 -0
- package/src/tools/merchants/list-supported-merchants.ts +52 -0
- package/src/tools/orders/retrieve-status-orders.ts +47 -0
- package/src/tools/products/retrieve-details-products.ts +48 -0
- package/src/tools/products/search-products.ts +78 -0
- package/src/tools/products/variant-check/create-products-variant-check.ts +85 -0
- package/src/tools/products/variant-check/retrieve-status-products-variant-check.ts +50 -0
- package/src/tools/types.ts +103 -0
- package/src/tools/wallet/create-card-collection-wallet.ts +49 -0
- package/src/tools.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/stdio.d.mts +3 -0
- package/stdio.d.mts.map +1 -0
- package/stdio.d.ts +3 -0
- package/stdio.d.ts.map +1 -0
- package/stdio.js +14 -0
- package/stdio.js.map +1 -0
- package/stdio.mjs +10 -0
- package/stdio.mjs.map +1 -0
- package/tools/cart/create-checkout-cart.d.mts +45 -0
- package/tools/cart/create-checkout-cart.d.mts.map +1 -0
- package/tools/cart/create-checkout-cart.d.ts +45 -0
- package/tools/cart/create-checkout-cart.d.ts.map +1 -0
- package/tools/cart/create-checkout-cart.js +44 -0
- package/tools/cart/create-checkout-cart.js.map +1 -0
- package/tools/cart/create-checkout-cart.mjs +40 -0
- package/tools/cart/create-checkout-cart.mjs.map +1 -0
- package/tools/cart/items/add-cart-items.d.mts +45 -0
- package/tools/cart/items/add-cart-items.d.mts.map +1 -0
- package/tools/cart/items/add-cart-items.d.ts +45 -0
- package/tools/cart/items/add-cart-items.d.ts.map +1 -0
- package/tools/cart/items/add-cart-items.js +86 -0
- package/tools/cart/items/add-cart-items.js.map +1 -0
- package/tools/cart/items/add-cart-items.mjs +82 -0
- package/tools/cart/items/add-cart-items.mjs.map +1 -0
- package/tools/cart/items/clear-cart-items.d.mts +45 -0
- package/tools/cart/items/clear-cart-items.d.mts.map +1 -0
- package/tools/cart/items/clear-cart-items.d.ts +45 -0
- package/tools/cart/items/clear-cart-items.d.ts.map +1 -0
- package/tools/cart/items/clear-cart-items.js +42 -0
- package/tools/cart/items/clear-cart-items.js.map +1 -0
- package/tools/cart/items/clear-cart-items.mjs +38 -0
- package/tools/cart/items/clear-cart-items.mjs.map +1 -0
- package/tools/cart/items/list-cart-items.d.mts +45 -0
- package/tools/cart/items/list-cart-items.d.mts.map +1 -0
- package/tools/cart/items/list-cart-items.d.ts +45 -0
- package/tools/cart/items/list-cart-items.d.ts.map +1 -0
- package/tools/cart/items/list-cart-items.js +42 -0
- package/tools/cart/items/list-cart-items.js.map +1 -0
- package/tools/cart/items/list-cart-items.mjs +38 -0
- package/tools/cart/items/list-cart-items.mjs.map +1 -0
- package/tools/cart/items/remove-cart-items.d.mts +45 -0
- package/tools/cart/items/remove-cart-items.d.mts.map +1 -0
- package/tools/cart/items/remove-cart-items.d.ts +45 -0
- package/tools/cart/items/remove-cart-items.d.ts.map +1 -0
- package/tools/cart/items/remove-cart-items.js +45 -0
- package/tools/cart/items/remove-cart-items.js.map +1 -0
- package/tools/cart/items/remove-cart-items.mjs +41 -0
- package/tools/cart/items/remove-cart-items.mjs.map +1 -0
- package/tools/checkout/session/confirm-checkout-checkout-session.d.mts +45 -0
- package/tools/checkout/session/confirm-checkout-checkout-session.d.mts.map +1 -0
- package/tools/checkout/session/confirm-checkout-checkout-session.d.ts +45 -0
- package/tools/checkout/session/confirm-checkout-checkout-session.d.ts.map +1 -0
- package/tools/checkout/session/confirm-checkout-checkout-session.js +94 -0
- package/tools/checkout/session/confirm-checkout-checkout-session.js.map +1 -0
- package/tools/checkout/session/confirm-checkout-checkout-session.mjs +90 -0
- package/tools/checkout/session/confirm-checkout-checkout-session.mjs.map +1 -0
- package/tools/checkout/session/create-quote-checkout-session.d.mts +45 -0
- package/tools/checkout/session/create-quote-checkout-session.d.mts.map +1 -0
- package/tools/checkout/session/create-quote-checkout-session.d.ts +45 -0
- package/tools/checkout/session/create-quote-checkout-session.d.ts.map +1 -0
- package/tools/checkout/session/create-quote-checkout-session.js +91 -0
- package/tools/checkout/session/create-quote-checkout-session.js.map +1 -0
- package/tools/checkout/session/create-quote-checkout-session.mjs +87 -0
- package/tools/checkout/session/create-quote-checkout-session.mjs.map +1 -0
- package/tools/checkout/session/list-products-checkout-session.d.mts +45 -0
- package/tools/checkout/session/list-products-checkout-session.d.mts.map +1 -0
- package/tools/checkout/session/list-products-checkout-session.d.ts +45 -0
- package/tools/checkout/session/list-products-checkout-session.d.ts.map +1 -0
- package/tools/checkout/session/list-products-checkout-session.js +42 -0
- package/tools/checkout/session/list-products-checkout-session.js.map +1 -0
- package/tools/checkout/session/list-products-checkout-session.mjs +38 -0
- package/tools/checkout/session/list-products-checkout-session.mjs.map +1 -0
- package/tools/checkout/session/retrieve-shipping-info-checkout-session.d.mts +45 -0
- package/tools/checkout/session/retrieve-shipping-info-checkout-session.d.mts.map +1 -0
- package/tools/checkout/session/retrieve-shipping-info-checkout-session.d.ts +45 -0
- package/tools/checkout/session/retrieve-shipping-info-checkout-session.d.ts.map +1 -0
- package/tools/checkout/session/retrieve-shipping-info-checkout-session.js +42 -0
- package/tools/checkout/session/retrieve-shipping-info-checkout-session.js.map +1 -0
- package/tools/checkout/session/retrieve-shipping-info-checkout-session.mjs +38 -0
- package/tools/checkout/session/retrieve-shipping-info-checkout-session.mjs.map +1 -0
- package/tools/index.d.mts +10 -0
- package/tools/index.d.mts.map +1 -0
- package/tools/index.d.ts +10 -0
- package/tools/index.d.ts.map +1 -0
- package/tools/index.js +89 -0
- package/tools/index.js.map +1 -0
- package/tools/index.mjs +82 -0
- package/tools/index.mjs.map +1 -0
- package/tools/merchants/check-status-merchants.d.mts +45 -0
- package/tools/merchants/check-status-merchants.d.mts.map +1 -0
- package/tools/merchants/check-status-merchants.d.ts +45 -0
- package/tools/merchants/check-status-merchants.d.ts.map +1 -0
- package/tools/merchants/check-status-merchants.js +48 -0
- package/tools/merchants/check-status-merchants.js.map +1 -0
- package/tools/merchants/check-status-merchants.mjs +44 -0
- package/tools/merchants/check-status-merchants.mjs.map +1 -0
- package/tools/merchants/get-shipping-info-merchants.d.mts +45 -0
- package/tools/merchants/get-shipping-info-merchants.d.mts.map +1 -0
- package/tools/merchants/get-shipping-info-merchants.d.ts +45 -0
- package/tools/merchants/get-shipping-info-merchants.d.ts.map +1 -0
- package/tools/merchants/get-shipping-info-merchants.js +55 -0
- package/tools/merchants/get-shipping-info-merchants.js.map +1 -0
- package/tools/merchants/get-shipping-info-merchants.mjs +51 -0
- package/tools/merchants/get-shipping-info-merchants.mjs.map +1 -0
- package/tools/merchants/list-supported-merchants.d.mts +45 -0
- package/tools/merchants/list-supported-merchants.d.mts.map +1 -0
- package/tools/merchants/list-supported-merchants.d.ts +45 -0
- package/tools/merchants/list-supported-merchants.d.ts.map +1 -0
- package/tools/merchants/list-supported-merchants.js +47 -0
- package/tools/merchants/list-supported-merchants.js.map +1 -0
- package/tools/merchants/list-supported-merchants.mjs +43 -0
- package/tools/merchants/list-supported-merchants.mjs.map +1 -0
- package/tools/orders/retrieve-status-orders.d.mts +45 -0
- package/tools/orders/retrieve-status-orders.d.mts.map +1 -0
- package/tools/orders/retrieve-status-orders.d.ts +45 -0
- package/tools/orders/retrieve-status-orders.d.ts.map +1 -0
- package/tools/orders/retrieve-status-orders.js +42 -0
- package/tools/orders/retrieve-status-orders.js.map +1 -0
- package/tools/orders/retrieve-status-orders.mjs +38 -0
- package/tools/orders/retrieve-status-orders.mjs.map +1 -0
- package/tools/products/retrieve-details-products.d.mts +45 -0
- package/tools/products/retrieve-details-products.d.mts.map +1 -0
- package/tools/products/retrieve-details-products.d.ts +45 -0
- package/tools/products/retrieve-details-products.d.ts.map +1 -0
- package/tools/products/retrieve-details-products.js +43 -0
- package/tools/products/retrieve-details-products.js.map +1 -0
- package/tools/products/retrieve-details-products.mjs +39 -0
- package/tools/products/retrieve-details-products.mjs.map +1 -0
- package/tools/products/search-products.d.mts +45 -0
- package/tools/products/search-products.d.mts.map +1 -0
- package/tools/products/search-products.d.ts +45 -0
- package/tools/products/search-products.d.ts.map +1 -0
- package/tools/products/search-products.js +73 -0
- package/tools/products/search-products.js.map +1 -0
- package/tools/products/search-products.mjs +69 -0
- package/tools/products/search-products.mjs.map +1 -0
- package/tools/products/variant-check/create-products-variant-check.d.mts +45 -0
- package/tools/products/variant-check/create-products-variant-check.d.mts.map +1 -0
- package/tools/products/variant-check/create-products-variant-check.d.ts +45 -0
- package/tools/products/variant-check/create-products-variant-check.d.ts.map +1 -0
- package/tools/products/variant-check/create-products-variant-check.js +79 -0
- package/tools/products/variant-check/create-products-variant-check.js.map +1 -0
- package/tools/products/variant-check/create-products-variant-check.mjs +75 -0
- package/tools/products/variant-check/create-products-variant-check.mjs.map +1 -0
- package/tools/products/variant-check/retrieve-status-products-variant-check.d.mts +45 -0
- package/tools/products/variant-check/retrieve-status-products-variant-check.d.mts.map +1 -0
- package/tools/products/variant-check/retrieve-status-products-variant-check.d.ts +45 -0
- package/tools/products/variant-check/retrieve-status-products-variant-check.d.ts.map +1 -0
- package/tools/products/variant-check/retrieve-status-products-variant-check.js +43 -0
- package/tools/products/variant-check/retrieve-status-products-variant-check.js.map +1 -0
- package/tools/products/variant-check/retrieve-status-products-variant-check.mjs +39 -0
- package/tools/products/variant-check/retrieve-status-products-variant-check.mjs.map +1 -0
- package/tools/types.d.mts +51 -0
- package/tools/types.d.mts.map +1 -0
- package/tools/types.d.ts +51 -0
- package/tools/types.d.ts.map +1 -0
- package/tools/types.js +46 -0
- package/tools/types.js.map +1 -0
- package/tools/types.mjs +42 -0
- package/tools/types.mjs.map +1 -0
- package/tools/wallet/create-card-collection-wallet.d.mts +45 -0
- package/tools/wallet/create-card-collection-wallet.d.mts.map +1 -0
- package/tools/wallet/create-card-collection-wallet.d.ts +45 -0
- package/tools/wallet/create-card-collection-wallet.d.ts.map +1 -0
- package/tools/wallet/create-card-collection-wallet.js +44 -0
- package/tools/wallet/create-card-collection-wallet.js.map +1 -0
- package/tools/wallet/create-card-collection-wallet.mjs +40 -0
- package/tools/wallet/create-card-collection-wallet.mjs.map +1 -0
- package/tools.d.mts +2 -0
- package/tools.d.mts.map +1 -0
- package/tools.d.ts +2 -0
- package/tools.d.ts.map +1 -0
- package/tools.js +18 -0
- package/tools.js.map +1 -0
- package/tools.mjs +2 -0
- package/tools.mjs.map +1 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
|
+
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import HenrySDK from '@henrylabs/sdk';
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
resource: 'checkout.session',
|
|
11
|
+
operation: 'write',
|
|
12
|
+
tags: [],
|
|
13
|
+
httpMethod: 'post',
|
|
14
|
+
httpPath: '/checkout/session/quote',
|
|
15
|
+
operationId: 'createCheckoutSessionQuote',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const tool: Tool = {
|
|
19
|
+
name: 'create_quote_checkout_session',
|
|
20
|
+
description:
|
|
21
|
+
"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\nCreates or updates a checkout session with shipping details and returns pricing metadata plus a session token.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/session_create_quote_response',\n $defs: {\n session_create_quote_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 order_metadata: {\n type: 'object',\n properties: {\n shipping: {\n type: 'object',\n additionalProperties: true\n },\n shipping_total: {\n type: 'number'\n },\n tax: {\n type: 'number'\n },\n total_price: {\n type: 'number'\n }\n },\n required: [ 'shipping',\n 'shipping_total',\n 'tax',\n 'total_price'\n ]\n },\n session_token: {\n type: 'string'\n }\n },\n required: [ 'order_metadata',\n 'session_token'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
shippingDetails: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
addressLine1: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
description: 'Address line 1',
|
|
31
|
+
},
|
|
32
|
+
city: {
|
|
33
|
+
type: 'string',
|
|
34
|
+
description: 'City',
|
|
35
|
+
},
|
|
36
|
+
countryCode: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
description: 'Country code',
|
|
39
|
+
},
|
|
40
|
+
email: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
description: 'Email',
|
|
43
|
+
},
|
|
44
|
+
fullName: {
|
|
45
|
+
type: 'string',
|
|
46
|
+
description: 'Full name',
|
|
47
|
+
},
|
|
48
|
+
phoneNumber: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
description: 'Phone number',
|
|
51
|
+
},
|
|
52
|
+
postalCode: {
|
|
53
|
+
type: 'string',
|
|
54
|
+
description: 'Postal code',
|
|
55
|
+
},
|
|
56
|
+
stateOrProvince: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
description: 'State or province',
|
|
59
|
+
},
|
|
60
|
+
addressLine2: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
description: 'Address line 2',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
required: [
|
|
66
|
+
'addressLine1',
|
|
67
|
+
'city',
|
|
68
|
+
'countryCode',
|
|
69
|
+
'email',
|
|
70
|
+
'fullName',
|
|
71
|
+
'phoneNumber',
|
|
72
|
+
'postalCode',
|
|
73
|
+
'stateOrProvince',
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
'x-user-id': {
|
|
77
|
+
type: 'string',
|
|
78
|
+
},
|
|
79
|
+
jq_filter: {
|
|
80
|
+
type: 'string',
|
|
81
|
+
title: 'jq Filter',
|
|
82
|
+
description:
|
|
83
|
+
'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/).',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
required: ['shippingDetails', 'x-user-id'],
|
|
87
|
+
},
|
|
88
|
+
annotations: {},
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
92
|
+
const { jq_filter, ...body } = args as any;
|
|
93
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.checkout.session.createQuote(body)));
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export default { metadata, tool, handler };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
|
+
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import HenrySDK from '@henrylabs/sdk';
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
resource: 'checkout.session',
|
|
11
|
+
operation: 'read',
|
|
12
|
+
tags: [],
|
|
13
|
+
httpMethod: 'get',
|
|
14
|
+
httpPath: '/checkout/session/products',
|
|
15
|
+
operationId: 'getCheckoutSessionProducts',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const tool: Tool = {
|
|
19
|
+
name: 'list_products_checkout_session',
|
|
20
|
+
description:
|
|
21
|
+
"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\nReturns products for the checkout session\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/session_list_products_response',\n $defs: {\n session_list_products_response: {\n type: 'object',\n properties: {\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n },\n data: {\n type: 'object',\n properties: {\n products: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: {\n type: 'string',\n description: 'Product name'\n },\n price: {\n type: 'string',\n description: 'Product price'\n },\n productLink: {\n type: 'string',\n description: 'Product link'\n },\n quantity: {\n type: 'number',\n description: 'Quantity'\n },\n affiliateProductLink: {\n type: 'string',\n description: 'Affiliate product link (if provided, will be used instead of productLink for order fulfillment)'\n },\n metadata: {\n type: 'object',\n description: 'Product metadata',\n additionalProperties: true\n },\n productId: {\n type: 'string',\n description: 'Product Id'\n },\n productImageLink: {\n type: 'string',\n description: 'Product image link (thumbnail)'\n },\n variantCheck: {\n type: 'object',\n properties: {\n completedAt: {\n type: 'string'\n },\n createdAt: {\n type: 'string'\n },\n errorMessage: {\n type: 'string'\n },\n requestId: {\n type: 'string'\n },\n result: {\n type: 'object',\n additionalProperties: true\n },\n status: {\n type: 'string'\n }\n },\n required: [ 'completedAt',\n 'createdAt',\n 'errorMessage',\n 'requestId',\n 'result',\n 'status'\n ]\n }\n },\n required: [ 'name',\n 'price',\n 'productLink',\n 'quantity'\n ]\n }\n }\n },\n required: [ 'products'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
'x-session-token': {
|
|
26
|
+
type: 'string',
|
|
27
|
+
},
|
|
28
|
+
jq_filter: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
title: 'jq Filter',
|
|
31
|
+
description:
|
|
32
|
+
'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/).',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
required: ['x-session-token'],
|
|
36
|
+
},
|
|
37
|
+
annotations: {
|
|
38
|
+
readOnlyHint: true,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
43
|
+
const { jq_filter, ...body } = args as any;
|
|
44
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.checkout.session.listProducts(body)));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default { metadata, tool, handler };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
|
+
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import HenrySDK from '@henrylabs/sdk';
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
resource: 'checkout.session',
|
|
11
|
+
operation: 'read',
|
|
12
|
+
tags: [],
|
|
13
|
+
httpMethod: 'get',
|
|
14
|
+
httpPath: '/checkout/session/shipping',
|
|
15
|
+
operationId: 'getCheckoutSessionShipping',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const tool: Tool = {
|
|
19
|
+
name: 'retrieve_shipping_info_checkout_session',
|
|
20
|
+
description:
|
|
21
|
+
"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\nRetrieves the shipping details for the current checkout session.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/session_retrieve_shipping_info_response',\n $defs: {\n session_retrieve_shipping_info_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 hasShipping: {\n type: 'boolean'\n },\n shippingDetails: {\n type: 'object',\n properties: {\n addressLine1: {\n type: 'string',\n description: 'Address line 1'\n },\n city: {\n type: 'string',\n description: 'City'\n },\n countryCode: {\n type: 'string',\n description: 'Country code'\n },\n email: {\n type: 'string',\n description: 'Email'\n },\n fullName: {\n type: 'string',\n description: 'Full name'\n },\n phoneNumber: {\n type: 'string',\n description: 'Phone number'\n },\n postalCode: {\n type: 'string',\n description: 'Postal code'\n },\n stateOrProvince: {\n type: 'string',\n description: 'State or province'\n },\n addressLine2: {\n type: 'string',\n description: 'Address line 2'\n }\n },\n required: [ 'addressLine1',\n 'city',\n 'countryCode',\n 'email',\n 'fullName',\n 'phoneNumber',\n 'postalCode',\n 'stateOrProvince'\n ]\n }\n },\n required: [ 'hasShipping',\n 'shippingDetails'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
'x-user-id': {
|
|
26
|
+
type: 'string',
|
|
27
|
+
},
|
|
28
|
+
jq_filter: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
title: 'jq Filter',
|
|
31
|
+
description:
|
|
32
|
+
'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/).',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
required: [],
|
|
36
|
+
},
|
|
37
|
+
annotations: {
|
|
38
|
+
readOnlyHint: true,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
43
|
+
const { jq_filter, ...body } = args as any;
|
|
44
|
+
return asTextContentResult(
|
|
45
|
+
await maybeFilter(jq_filter, await client.checkout.session.retrieveShippingInfo(body)),
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default { metadata, tool, handler };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { Metadata, Endpoint, HandlerFunction } from './types';
|
|
4
|
+
|
|
5
|
+
export { Metadata, Endpoint, HandlerFunction };
|
|
6
|
+
|
|
7
|
+
import retrieve_details_products from './products/retrieve-details-products';
|
|
8
|
+
import search_products from './products/search-products';
|
|
9
|
+
import create_products_variant_check from './products/variant-check/create-products-variant-check';
|
|
10
|
+
import retrieve_status_products_variant_check from './products/variant-check/retrieve-status-products-variant-check';
|
|
11
|
+
import create_checkout_cart from './cart/create-checkout-cart';
|
|
12
|
+
import list_cart_items from './cart/items/list-cart-items';
|
|
13
|
+
import add_cart_items from './cart/items/add-cart-items';
|
|
14
|
+
import clear_cart_items from './cart/items/clear-cart-items';
|
|
15
|
+
import remove_cart_items from './cart/items/remove-cart-items';
|
|
16
|
+
import confirm_checkout_checkout_session from './checkout/session/confirm-checkout-checkout-session';
|
|
17
|
+
import create_quote_checkout_session from './checkout/session/create-quote-checkout-session';
|
|
18
|
+
import list_products_checkout_session from './checkout/session/list-products-checkout-session';
|
|
19
|
+
import retrieve_shipping_info_checkout_session from './checkout/session/retrieve-shipping-info-checkout-session';
|
|
20
|
+
import retrieve_status_orders from './orders/retrieve-status-orders';
|
|
21
|
+
import create_card_collection_wallet from './wallet/create-card-collection-wallet';
|
|
22
|
+
import check_status_merchants from './merchants/check-status-merchants';
|
|
23
|
+
import get_shipping_info_merchants from './merchants/get-shipping-info-merchants';
|
|
24
|
+
import list_supported_merchants from './merchants/list-supported-merchants';
|
|
25
|
+
|
|
26
|
+
export const endpoints: Endpoint[] = [];
|
|
27
|
+
|
|
28
|
+
function addEndpoint(endpoint: Endpoint) {
|
|
29
|
+
endpoints.push(endpoint);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
addEndpoint(retrieve_details_products);
|
|
33
|
+
addEndpoint(search_products);
|
|
34
|
+
addEndpoint(create_products_variant_check);
|
|
35
|
+
addEndpoint(retrieve_status_products_variant_check);
|
|
36
|
+
addEndpoint(create_checkout_cart);
|
|
37
|
+
addEndpoint(list_cart_items);
|
|
38
|
+
addEndpoint(add_cart_items);
|
|
39
|
+
addEndpoint(clear_cart_items);
|
|
40
|
+
addEndpoint(remove_cart_items);
|
|
41
|
+
addEndpoint(confirm_checkout_checkout_session);
|
|
42
|
+
addEndpoint(create_quote_checkout_session);
|
|
43
|
+
addEndpoint(list_products_checkout_session);
|
|
44
|
+
addEndpoint(retrieve_shipping_info_checkout_session);
|
|
45
|
+
addEndpoint(retrieve_status_orders);
|
|
46
|
+
addEndpoint(create_card_collection_wallet);
|
|
47
|
+
addEndpoint(check_status_merchants);
|
|
48
|
+
addEndpoint(get_shipping_info_merchants);
|
|
49
|
+
addEndpoint(list_supported_merchants);
|
|
50
|
+
|
|
51
|
+
export type Filter = {
|
|
52
|
+
type: 'resource' | 'operation' | 'tag' | 'tool';
|
|
53
|
+
op: 'include' | 'exclude';
|
|
54
|
+
value: string;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export function query(filters: Filter[], endpoints: Endpoint[]): Endpoint[] {
|
|
58
|
+
const allExcludes = filters.length > 0 && filters.every((filter) => filter.op === 'exclude');
|
|
59
|
+
const unmatchedFilters = new Set(filters);
|
|
60
|
+
|
|
61
|
+
const filtered = endpoints.filter((endpoint: Endpoint) => {
|
|
62
|
+
let included = false || allExcludes;
|
|
63
|
+
|
|
64
|
+
for (const filter of filters) {
|
|
65
|
+
if (match(filter, endpoint)) {
|
|
66
|
+
unmatchedFilters.delete(filter);
|
|
67
|
+
included = filter.op === 'include';
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return included;
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// Check if any filters didn't match
|
|
75
|
+
const unmatched = Array.from(unmatchedFilters).filter((f) => f.type === 'tool' || f.type === 'resource');
|
|
76
|
+
if (unmatched.length > 0) {
|
|
77
|
+
throw new Error(
|
|
78
|
+
`The following filters did not match any endpoints: ${unmatched
|
|
79
|
+
.map((f) => `${f.type}=${f.value}`)
|
|
80
|
+
.join(', ')}`,
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return filtered;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function match({ type, value }: Filter, endpoint: Endpoint): boolean {
|
|
88
|
+
switch (type) {
|
|
89
|
+
case 'resource': {
|
|
90
|
+
const regexStr = '^' + normalizeResource(value).replace(/\*/g, '.*') + '$';
|
|
91
|
+
const regex = new RegExp(regexStr);
|
|
92
|
+
return regex.test(normalizeResource(endpoint.metadata.resource));
|
|
93
|
+
}
|
|
94
|
+
case 'operation':
|
|
95
|
+
return endpoint.metadata.operation === value;
|
|
96
|
+
case 'tag':
|
|
97
|
+
return endpoint.metadata.tags.includes(value);
|
|
98
|
+
case 'tool':
|
|
99
|
+
return endpoint.tool.name === value;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function normalizeResource(resource: string): string {
|
|
104
|
+
return resource.toLowerCase().replace(/[^a-z.*\-_]*/g, '');
|
|
105
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
|
+
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import HenrySDK from '@henrylabs/sdk';
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
resource: 'merchants',
|
|
11
|
+
operation: 'read',
|
|
12
|
+
tags: [],
|
|
13
|
+
httpMethod: 'get',
|
|
14
|
+
httpPath: '/merchants/{merchantDomain}/status',
|
|
15
|
+
operationId: 'merchantSupport',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const tool: Tool = {
|
|
19
|
+
name: 'check_status_merchants',
|
|
20
|
+
description:
|
|
21
|
+
"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\nVerifies whether a merchant is supported by checking their domain\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/merchant_check_status_response',\n $defs: {\n merchant_check_status_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 merchantSupportStatus: {\n type: 'boolean'\n }\n },\n required: [ 'merchantSupportStatus'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
merchantDomain: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description: 'Merchant Domain',
|
|
28
|
+
},
|
|
29
|
+
checkoutMode: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
description:
|
|
32
|
+
"Checkout mode to check merchant support against. 'allowlist' only allows explicitly approved merchants, 'blocklist' allows all except explicitly blocked merchants.",
|
|
33
|
+
enum: ['allowlist', 'blocklist'],
|
|
34
|
+
},
|
|
35
|
+
jq_filter: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
title: 'jq Filter',
|
|
38
|
+
description:
|
|
39
|
+
'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/).',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
required: ['merchantDomain'],
|
|
43
|
+
},
|
|
44
|
+
annotations: {
|
|
45
|
+
readOnlyHint: true,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
50
|
+
const { merchantDomain, jq_filter, ...body } = args as any;
|
|
51
|
+
return asTextContentResult(
|
|
52
|
+
await maybeFilter(jq_filter, await client.merchants.checkStatus(merchantDomain, body)),
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default { metadata, tool, handler };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
|
+
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import HenrySDK from '@henrylabs/sdk';
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
resource: 'merchants',
|
|
11
|
+
operation: 'read',
|
|
12
|
+
tags: [],
|
|
13
|
+
httpMethod: 'get',
|
|
14
|
+
httpPath: '/merchants/shipping-info',
|
|
15
|
+
operationId: 'getMerchantShippingInfo',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const tool: Tool = {
|
|
19
|
+
name: 'get_shipping_info_merchants',
|
|
20
|
+
description:
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nRetrieve shipping information including shipping tiers and free shipping thresholds for merchants\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/merchant_get_shipping_info_response',\n $defs: {\n merchant_get_shipping_info_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 hasMore: {\n type: 'boolean'\n },\n merchants: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string'\n },\n displayName: {\n type: 'string'\n },\n domain: {\n type: 'string'\n },\n freeShippingThreshold: {\n type: 'number'\n },\n name: {\n type: 'string'\n },\n shippingNotes: {\n type: 'string'\n },\n shippingTiers: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string'\n },\n cost: {\n type: 'number'\n },\n estimatedDeliveryMaxDays: {\n type: 'number'\n },\n estimatedDeliveryMinDays: {\n type: 'number'\n },\n tierName: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'cost',\n 'estimatedDeliveryMaxDays',\n 'estimatedDeliveryMinDays',\n 'tierName'\n ]\n }\n }\n },\n required: [ 'id',\n 'displayName',\n 'domain',\n 'freeShippingThreshold',\n 'name',\n 'shippingNotes',\n 'shippingTiers'\n ]\n }\n },\n totalCount: {\n type: 'number'\n }\n },\n required: [ 'hasMore',\n 'merchants',\n 'totalCount'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
domain: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description: 'Merchant domain to filter by',
|
|
28
|
+
},
|
|
29
|
+
limit: {
|
|
30
|
+
type: 'integer',
|
|
31
|
+
description: 'Number of items per page (1-100)',
|
|
32
|
+
},
|
|
33
|
+
merchantId: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
description: 'Merchant ID to filter by',
|
|
36
|
+
},
|
|
37
|
+
offset: {
|
|
38
|
+
type: 'integer',
|
|
39
|
+
description: 'Number of items to skip',
|
|
40
|
+
},
|
|
41
|
+
jq_filter: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
title: 'jq Filter',
|
|
44
|
+
description:
|
|
45
|
+
'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/).',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
required: [],
|
|
49
|
+
},
|
|
50
|
+
annotations: {
|
|
51
|
+
readOnlyHint: true,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
56
|
+
const { jq_filter, ...body } = args as any;
|
|
57
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.merchants.getShippingInfo(body)));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export default { metadata, tool, handler };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
|
+
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import HenrySDK from '@henrylabs/sdk';
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
resource: 'merchants',
|
|
11
|
+
operation: 'read',
|
|
12
|
+
tags: [],
|
|
13
|
+
httpMethod: 'get',
|
|
14
|
+
httpPath: '/merchants/list',
|
|
15
|
+
operationId: 'getSupportedMerchants',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const tool: Tool = {
|
|
19
|
+
name: 'list_supported_merchants',
|
|
20
|
+
description:
|
|
21
|
+
"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\nReturns a list of allowlist supported merchants\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/merchant_list_supported_response',\n $defs: {\n merchant_list_supported_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 merchants: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string'\n },\n domain: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n website: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'domain',\n 'name'\n ]\n }\n },\n pagination: {\n type: 'object',\n properties: {\n currentPage: {\n type: 'number'\n },\n hasNextPage: {\n type: 'boolean'\n },\n hasPreviousPage: {\n type: 'boolean'\n },\n limit: {\n type: 'number'\n },\n totalCount: {\n type: 'number'\n },\n totalPages: {\n type: 'number'\n }\n },\n required: [ 'currentPage',\n 'hasNextPage',\n 'hasPreviousPage',\n 'limit',\n 'totalCount',\n 'totalPages'\n ]\n }\n },\n required: [ 'merchants',\n 'pagination'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
limit: {
|
|
26
|
+
type: 'integer',
|
|
27
|
+
description: 'Number of items per page (1-100)',
|
|
28
|
+
},
|
|
29
|
+
page: {
|
|
30
|
+
type: 'integer',
|
|
31
|
+
description: 'Page number (starts from 1)',
|
|
32
|
+
},
|
|
33
|
+
jq_filter: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
title: 'jq Filter',
|
|
36
|
+
description:
|
|
37
|
+
'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/).',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
required: [],
|
|
41
|
+
},
|
|
42
|
+
annotations: {
|
|
43
|
+
readOnlyHint: true,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
48
|
+
const { jq_filter, ...body } = args as any;
|
|
49
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.merchants.listSupported(body)));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default { metadata, tool, handler };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
|
+
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import HenrySDK from '@henrylabs/sdk';
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
resource: 'orders',
|
|
11
|
+
operation: 'read',
|
|
12
|
+
tags: [],
|
|
13
|
+
httpMethod: 'get',
|
|
14
|
+
httpPath: '/orders/{orderId}',
|
|
15
|
+
operationId: 'getOrderStatus',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const tool: Tool = {
|
|
19
|
+
name: 'retrieve_status_orders',
|
|
20
|
+
description:
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nRetrieve the status and details of an order given order ID\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/order_retrieve_status_response',\n $defs: {\n order_retrieve_status_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 id: {\n type: 'string'\n },\n currency: {\n type: 'string'\n },\n grandTotal: {\n type: 'string'\n },\n products: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n productName: {\n type: 'string'\n },\n quantity: {\n type: 'number'\n },\n productMetadata: {\n type: 'object',\n additionalProperties: true\n }\n },\n required: [ 'productName',\n 'quantity'\n ]\n }\n },\n shipping: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n statusMessage: {\n type: 'string'\n },\n subtotal: {\n type: 'string'\n },\n tax: {\n type: 'string'\n },\n userId: {\n type: 'string'\n },\n shippingDetails: {\n type: 'object',\n properties: {\n addressLine1: {\n type: 'string'\n },\n city: {\n type: 'string'\n },\n countryCode: {\n type: 'string'\n },\n email: {\n type: 'string'\n },\n fullName: {\n type: 'string'\n },\n phoneNumber: {\n type: 'string'\n },\n postalCode: {\n type: 'string'\n },\n stateOrProvince: {\n type: 'string'\n },\n addressLine2: {\n type: 'string'\n }\n },\n required: [ 'addressLine1',\n 'city',\n 'countryCode',\n 'email',\n 'fullName',\n 'phoneNumber',\n 'postalCode',\n 'stateOrProvince'\n ]\n }\n },\n required: [ 'id',\n 'currency',\n 'grandTotal',\n 'products',\n 'shipping',\n 'status',\n 'statusMessage',\n 'subtotal',\n 'tax',\n 'userId'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
orderId: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
},
|
|
28
|
+
jq_filter: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
title: 'jq Filter',
|
|
31
|
+
description:
|
|
32
|
+
'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/).',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
required: ['orderId'],
|
|
36
|
+
},
|
|
37
|
+
annotations: {
|
|
38
|
+
readOnlyHint: true,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
43
|
+
const { orderId, jq_filter, ...body } = args as any;
|
|
44
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.orders.retrieveStatus(orderId)));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default { metadata, tool, handler };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { maybeFilter } from '@henrylabs/mcp/filtering';
|
|
4
|
+
import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
|
|
5
|
+
|
|
6
|
+
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import HenrySDK from '@henrylabs/sdk';
|
|
8
|
+
|
|
9
|
+
export const metadata: Metadata = {
|
|
10
|
+
resource: 'products',
|
|
11
|
+
operation: 'read',
|
|
12
|
+
tags: [],
|
|
13
|
+
httpMethod: 'get',
|
|
14
|
+
httpPath: '/products/details',
|
|
15
|
+
operationId: 'getProductDetails',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const tool: Tool = {
|
|
19
|
+
name: 'retrieve_details_products',
|
|
20
|
+
description:
|
|
21
|
+
"When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nRetrieve detailed information about a specific product given product ID\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/product_retrieve_details_response',\n $defs: {\n product_retrieve_details_response: {\n type: 'object',\n properties: {\n data: {\n type: 'object',\n properties: {\n productResults: {\n type: 'object',\n properties: {\n brand: {\n type: 'string'\n },\n rating: {\n type: 'number'\n },\n reviews: {\n type: 'number'\n },\n stores: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n link: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n price: {\n type: 'string'\n },\n shipping: {\n type: 'string'\n },\n total: {\n type: 'string'\n }\n },\n required: [ 'link',\n 'name',\n 'price',\n 'shipping',\n 'total'\n ]\n }\n },\n thumbnails: {\n type: 'array',\n items: {\n type: 'string'\n }\n },\n title: {\n type: 'string'\n },\n userReviews: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n rating: {\n type: 'number'\n },\n source: {\n type: 'string'\n },\n text: {\n type: 'string'\n },\n title: {\n type: 'string'\n },\n userName: {\n type: 'string'\n }\n },\n required: [ 'rating',\n 'source',\n 'text',\n 'title',\n 'userName'\n ]\n }\n },\n variants: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: {\n type: 'string'\n },\n available: {\n type: 'boolean'\n },\n selected: {\n type: 'boolean'\n }\n },\n required: [ 'name'\n ]\n }\n },\n title: {\n type: 'string'\n }\n },\n required: [ 'items',\n 'title'\n ]\n }\n }\n },\n required: [ 'brand',\n 'rating',\n 'reviews',\n 'stores',\n 'thumbnails',\n 'title',\n 'userReviews',\n 'variants'\n ]\n },\n relatedSearches: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n link: {\n type: 'string'\n },\n query: {\n type: 'string'\n },\n image: {\n type: 'string'\n }\n },\n required: [ 'link',\n 'query'\n ]\n }\n }\n },\n required: [ 'productResults',\n 'relatedSearches'\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```",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
productId: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description: 'Product ID',
|
|
28
|
+
},
|
|
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
|
+
},
|
|
36
|
+
required: ['productId'],
|
|
37
|
+
},
|
|
38
|
+
annotations: {
|
|
39
|
+
readOnlyHint: true,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
|
|
44
|
+
const { jq_filter, ...body } = args as any;
|
|
45
|
+
return asTextContentResult(await maybeFilter(jq_filter, await client.products.retrieveDetails(body)));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default { metadata, tool, handler };
|