@henrylabs/mcp 0.12.0 → 0.13.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.
Files changed (57) hide show
  1. package/README.md +4 -51
  2. package/code-tool-worker.d.mts.map +1 -1
  3. package/code-tool-worker.d.ts.map +1 -1
  4. package/code-tool-worker.js +0 -4
  5. package/code-tool-worker.js.map +1 -1
  6. package/code-tool-worker.mjs +0 -4
  7. package/code-tool-worker.mjs.map +1 -1
  8. package/package.json +2 -2
  9. package/server.js +1 -1
  10. package/server.mjs +1 -1
  11. package/src/code-tool-worker.ts +0 -4
  12. package/src/server.ts +1 -1
  13. package/src/tools/cart/items/add-cart-items.ts +1 -1
  14. package/src/tools/cart/items/clear-cart-items.ts +1 -1
  15. package/src/tools/cart/items/list-cart-items.ts +1 -1
  16. package/src/tools/cart/items/remove-cart-items.ts +1 -1
  17. package/src/tools/index.ts +0 -4
  18. package/tools/cart/items/add-cart-items.js +1 -1
  19. package/tools/cart/items/add-cart-items.js.map +1 -1
  20. package/tools/cart/items/add-cart-items.mjs +1 -1
  21. package/tools/cart/items/add-cart-items.mjs.map +1 -1
  22. package/tools/cart/items/clear-cart-items.js +1 -1
  23. package/tools/cart/items/clear-cart-items.js.map +1 -1
  24. package/tools/cart/items/clear-cart-items.mjs +1 -1
  25. package/tools/cart/items/clear-cart-items.mjs.map +1 -1
  26. package/tools/cart/items/list-cart-items.js +1 -1
  27. package/tools/cart/items/list-cart-items.js.map +1 -1
  28. package/tools/cart/items/list-cart-items.mjs +1 -1
  29. package/tools/cart/items/list-cart-items.mjs.map +1 -1
  30. package/tools/cart/items/remove-cart-items.js +1 -1
  31. package/tools/cart/items/remove-cart-items.js.map +1 -1
  32. package/tools/cart/items/remove-cart-items.mjs +1 -1
  33. package/tools/cart/items/remove-cart-items.mjs.map +1 -1
  34. package/tools/index.d.mts.map +1 -1
  35. package/tools/index.d.ts.map +1 -1
  36. package/tools/index.js +0 -4
  37. package/tools/index.js.map +1 -1
  38. package/tools/index.mjs +0 -4
  39. package/tools/index.mjs.map +1 -1
  40. package/src/tools/checkout/session/confirm-checkout-session.ts +0 -108
  41. package/src/tools/checkout/session/create-checkout-session.ts +0 -103
  42. package/tools/checkout/session/confirm-checkout-session.d.mts +0 -45
  43. package/tools/checkout/session/confirm-checkout-session.d.mts.map +0 -1
  44. package/tools/checkout/session/confirm-checkout-session.d.ts +0 -45
  45. package/tools/checkout/session/confirm-checkout-session.d.ts.map +0 -1
  46. package/tools/checkout/session/confirm-checkout-session.js +0 -102
  47. package/tools/checkout/session/confirm-checkout-session.js.map +0 -1
  48. package/tools/checkout/session/confirm-checkout-session.mjs +0 -98
  49. package/tools/checkout/session/confirm-checkout-session.mjs.map +0 -1
  50. package/tools/checkout/session/create-checkout-session.d.mts +0 -45
  51. package/tools/checkout/session/create-checkout-session.d.mts.map +0 -1
  52. package/tools/checkout/session/create-checkout-session.d.ts +0 -45
  53. package/tools/checkout/session/create-checkout-session.d.ts.map +0 -1
  54. package/tools/checkout/session/create-checkout-session.js +0 -99
  55. package/tools/checkout/session/create-checkout-session.js.map +0 -1
  56. package/tools/checkout/session/create-checkout-session.mjs +0 -95
  57. package/tools/checkout/session/create-checkout-session.mjs.map +0 -1
@@ -1,108 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
4
- import { Metadata, asErrorResult, 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/confirm',
15
- operationId: 'confirmCheckoutSession',
16
- };
17
-
18
- export const tool: Tool = {
19
- name: 'confirm_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\nFinalize the checkout and create an order. Returns order details with order ID.\n\nRequired:\n- x-session-token: From create_checkout_session\n- shippingDetails: Same address object used in create_checkout_session\n\nIMPORTANT: Must call collect_payment_details BEFORE this to save payment method.\n\nReturns order details:\n- id: Order ID (use with retrieve_status_orders)\n- products: List with productName, quantity, productMetadata\n- currency, subtotal, shipping, tax, grandTotal\n- shippingDetails: Delivery address\n- status: Order status (e.g., \"processing\")\n- statusMessage: Human-readable status\n- cardLast4: Last 4 digits of payment card (if available)\n\nAfter confirmation, provide order ID to user for tracking.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/session_confirm_checkout_response',\n $defs: {\n session_confirm_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 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 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 status: {\n type: 'string'\n },\n statusMessage: {\n type: 'string'\n },\n subtotal: {\n type: 'string'\n },\n tax: {\n type: 'string'\n },\n cardLast4: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'currency',\n 'grandTotal',\n 'products',\n 'shipping',\n 'shippingDetails',\n 'status',\n 'statusMessage',\n 'subtotal',\n 'tax'\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
- shippingDetails: {
29
- type: 'object',
30
- properties: {
31
- addressLine1: {
32
- type: 'string',
33
- description: 'Address line 1',
34
- },
35
- city: {
36
- type: 'string',
37
- description: 'City',
38
- },
39
- countryCode: {
40
- type: 'string',
41
- description: 'Country code',
42
- },
43
- email: {
44
- type: 'string',
45
- description: 'Email',
46
- },
47
- fullName: {
48
- type: 'string',
49
- description: 'Full name',
50
- },
51
- phoneNumber: {
52
- type: 'string',
53
- description: 'Phone number',
54
- },
55
- postalCode: {
56
- type: 'string',
57
- description: 'Postal code',
58
- },
59
- stateOrProvince: {
60
- type: 'string',
61
- description: 'State or province',
62
- },
63
- addressLine2: {
64
- type: 'string',
65
- description: 'Address line 2',
66
- },
67
- },
68
- required: [
69
- 'addressLine1',
70
- 'city',
71
- 'countryCode',
72
- 'email',
73
- 'fullName',
74
- 'phoneNumber',
75
- 'postalCode',
76
- 'stateOrProvince',
77
- ],
78
- },
79
- 'x-user-id': {
80
- type: 'string',
81
- },
82
- jq_filter: {
83
- type: 'string',
84
- title: 'jq Filter',
85
- description:
86
- '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/).',
87
- },
88
- },
89
- required: ['x-session-token'],
90
- },
91
- annotations: {},
92
- };
93
-
94
- export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
95
- const { jq_filter, ...body } = args as any;
96
- try {
97
- return asTextContentResult(
98
- await maybeFilter(jq_filter, await client.checkout.session.confirmCheckout(body)),
99
- );
100
- } catch (error) {
101
- if (isJqError(error)) {
102
- return asErrorResult(error.message);
103
- }
104
- throw error;
105
- }
106
- };
107
-
108
- export default { metadata, tool, handler };
@@ -1,103 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
4
- import { Metadata, asErrorResult, 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_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\nCreate/update a checkout session for headless checkout flow. Returns pricing breakdown and session token.\n\nRequired: shippingDetails object with:\n- fullName, email, phoneNumber\n- addressLine1, city, stateOrProvince, postalCode, countryCode\n- addressLine2 (optional)\n\nReturns:\n- order_metadata: shipping details, shipping_total, tax, total_price\n- session_token: Required for confirm_checkout_session\n\nThe session_token expires, so confirm checkout soon after receiving it.\n\nHeadless checkout flow:\n1. create_checkout_session (get quote + token)\n2. collect_payment_details (save card via modal)\n3. confirm_checkout_session (finalize order)\n\nUse hosted checkout (create_cart_checkout) for simpler implementation.\n\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
- try {
94
- return asTextContentResult(await maybeFilter(jq_filter, await client.checkout.session.createQuote(body)));
95
- } catch (error) {
96
- if (isJqError(error)) {
97
- return asErrorResult(error.message);
98
- }
99
- throw error;
100
- }
101
- };
102
-
103
- export default { metadata, tool, handler };
@@ -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=confirm-checkout-session.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-checkout-session.d.mts","sourceRoot":"","sources":["../../../src/tools/checkout/session/confirm-checkout-session.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,IA0ElB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAYxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAZoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAczF,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=confirm-checkout-session.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-checkout-session.d.ts","sourceRoot":"","sources":["../../../src/tools/checkout/session/confirm-checkout-session.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,IA0ElB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAU,QAAQ,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,iEAYxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAZoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAczF,wBAA2C"}
@@ -1,102 +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: 'checkout.session',
9
- operation: 'write',
10
- tags: [],
11
- httpMethod: 'post',
12
- httpPath: '/checkout/session/confirm',
13
- operationId: 'confirmCheckoutSession',
14
- };
15
- exports.tool = {
16
- name: 'confirm_checkout_session',
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\nFinalize the checkout and create an order. Returns order details with order ID.\n\nRequired:\n- x-session-token: From create_checkout_session\n- shippingDetails: Same address object used in create_checkout_session\n\nIMPORTANT: Must call collect_payment_details BEFORE this to save payment method.\n\nReturns order details:\n- id: Order ID (use with retrieve_status_orders)\n- products: List with productName, quantity, productMetadata\n- currency, subtotal, shipping, tax, grandTotal\n- shippingDetails: Delivery address\n- status: Order status (e.g., \"processing\")\n- statusMessage: Human-readable status\n- cardLast4: Last 4 digits of payment card (if available)\n\nAfter confirmation, provide order ID to user for tracking.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/session_confirm_checkout_response',\n $defs: {\n session_confirm_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 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 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 status: {\n type: 'string'\n },\n statusMessage: {\n type: 'string'\n },\n subtotal: {\n type: 'string'\n },\n tax: {\n type: 'string'\n },\n cardLast4: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'currency',\n 'grandTotal',\n 'products',\n 'shipping',\n 'shippingDetails',\n 'status',\n 'statusMessage',\n 'subtotal',\n 'tax'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
18
- inputSchema: {
19
- type: 'object',
20
- properties: {
21
- 'x-session-token': {
22
- type: 'string',
23
- },
24
- shippingDetails: {
25
- type: 'object',
26
- properties: {
27
- addressLine1: {
28
- type: 'string',
29
- description: 'Address line 1',
30
- },
31
- city: {
32
- type: 'string',
33
- description: 'City',
34
- },
35
- countryCode: {
36
- type: 'string',
37
- description: 'Country code',
38
- },
39
- email: {
40
- type: 'string',
41
- description: 'Email',
42
- },
43
- fullName: {
44
- type: 'string',
45
- description: 'Full name',
46
- },
47
- phoneNumber: {
48
- type: 'string',
49
- description: 'Phone number',
50
- },
51
- postalCode: {
52
- type: 'string',
53
- description: 'Postal code',
54
- },
55
- stateOrProvince: {
56
- type: 'string',
57
- description: 'State or province',
58
- },
59
- addressLine2: {
60
- type: 'string',
61
- description: 'Address line 2',
62
- },
63
- },
64
- required: [
65
- 'addressLine1',
66
- 'city',
67
- 'countryCode',
68
- 'email',
69
- 'fullName',
70
- 'phoneNumber',
71
- 'postalCode',
72
- 'stateOrProvince',
73
- ],
74
- },
75
- 'x-user-id': {
76
- type: 'string',
77
- },
78
- jq_filter: {
79
- type: 'string',
80
- title: 'jq Filter',
81
- 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/).',
82
- },
83
- },
84
- required: ['x-session-token'],
85
- },
86
- annotations: {},
87
- };
88
- const handler = async (client, args) => {
89
- const { jq_filter, ...body } = args;
90
- try {
91
- return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.checkout.session.confirmCheckout(body)));
92
- }
93
- catch (error) {
94
- if ((0, filtering_1.isJqError)(error)) {
95
- return (0, types_1.asErrorResult)(error.message);
96
- }
97
- throw error;
98
- }
99
- };
100
- exports.handler = handler;
101
- exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
102
- //# sourceMappingURL=confirm-checkout-session.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-checkout-session.js","sourceRoot":"","sources":["../../../src/tools/checkout/session/confirm-checkout-session.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAkE;AAClE,sDAA0F;AAK7E,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,kBAAkB;IAC5B,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,2BAA2B;IACrC,WAAW,EAAE,wBAAwB;CACtC,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EACT,mgJAAmgJ;IACrgJ,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,iBAAiB,EAAE;gBACjB,IAAI,EAAE,QAAQ;aACf;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,YAAY,EAAE;wBACZ,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,gBAAgB;qBAC9B;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,MAAM;qBACpB;oBACD,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,cAAc;qBAC5B;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,OAAO;qBACrB;oBACD,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,WAAW;qBACzB;oBACD,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,cAAc;qBAC5B;oBACD,UAAU,EAAE;wBACV,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,aAAa;qBAC3B;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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: 'checkout.session',
6
- operation: 'write',
7
- tags: [],
8
- httpMethod: 'post',
9
- httpPath: '/checkout/session/confirm',
10
- operationId: 'confirmCheckoutSession',
11
- };
12
- export const tool = {
13
- name: 'confirm_checkout_session',
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\nFinalize the checkout and create an order. Returns order details with order ID.\n\nRequired:\n- x-session-token: From create_checkout_session\n- shippingDetails: Same address object used in create_checkout_session\n\nIMPORTANT: Must call collect_payment_details BEFORE this to save payment method.\n\nReturns order details:\n- id: Order ID (use with retrieve_status_orders)\n- products: List with productName, quantity, productMetadata\n- currency, subtotal, shipping, tax, grandTotal\n- shippingDetails: Delivery address\n- status: Order status (e.g., \"processing\")\n- statusMessage: Human-readable status\n- cardLast4: Last 4 digits of payment card (if available)\n\nAfter confirmation, provide order ID to user for tracking.\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/session_confirm_checkout_response',\n $defs: {\n session_confirm_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 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 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 status: {\n type: 'string'\n },\n statusMessage: {\n type: 'string'\n },\n subtotal: {\n type: 'string'\n },\n tax: {\n type: 'string'\n },\n cardLast4: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'currency',\n 'grandTotal',\n 'products',\n 'shipping',\n 'shippingDetails',\n 'status',\n 'statusMessage',\n 'subtotal',\n 'tax'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
15
- inputSchema: {
16
- type: 'object',
17
- properties: {
18
- 'x-session-token': {
19
- type: 'string',
20
- },
21
- shippingDetails: {
22
- type: 'object',
23
- properties: {
24
- addressLine1: {
25
- type: 'string',
26
- description: 'Address line 1',
27
- },
28
- city: {
29
- type: 'string',
30
- description: 'City',
31
- },
32
- countryCode: {
33
- type: 'string',
34
- description: 'Country code',
35
- },
36
- email: {
37
- type: 'string',
38
- description: 'Email',
39
- },
40
- fullName: {
41
- type: 'string',
42
- description: 'Full name',
43
- },
44
- phoneNumber: {
45
- type: 'string',
46
- description: 'Phone number',
47
- },
48
- postalCode: {
49
- type: 'string',
50
- description: 'Postal code',
51
- },
52
- stateOrProvince: {
53
- type: 'string',
54
- description: 'State or province',
55
- },
56
- addressLine2: {
57
- type: 'string',
58
- description: 'Address line 2',
59
- },
60
- },
61
- required: [
62
- 'addressLine1',
63
- 'city',
64
- 'countryCode',
65
- 'email',
66
- 'fullName',
67
- 'phoneNumber',
68
- 'postalCode',
69
- 'stateOrProvince',
70
- ],
71
- },
72
- 'x-user-id': {
73
- type: 'string',
74
- },
75
- jq_filter: {
76
- type: 'string',
77
- title: 'jq Filter',
78
- 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/).',
79
- },
80
- },
81
- required: ['x-session-token'],
82
- },
83
- annotations: {},
84
- };
85
- export const handler = async (client, args) => {
86
- const { jq_filter, ...body } = args;
87
- try {
88
- return asTextContentResult(await maybeFilter(jq_filter, await client.checkout.session.confirmCheckout(body)));
89
- }
90
- catch (error) {
91
- if (isJqError(error)) {
92
- return asErrorResult(error.message);
93
- }
94
- throw error;
95
- }
96
- };
97
- export default { metadata, tool, handler };
98
- //# sourceMappingURL=confirm-checkout-session.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirm-checkout-session.mjs","sourceRoot":"","sources":["../../../src/tools/checkout/session/confirm-checkout-session.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,kBAAkB;IAC5B,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,2BAA2B;IACrC,WAAW,EAAE,wBAAwB;CACtC,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EACT,mgJAAmgJ;IACrgJ,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,iBAAiB,EAAE;gBACjB,IAAI,EAAE,QAAQ;aACf;YACD,eAAe,EAAE;gBACf,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,YAAY,EAAE;w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AAM,WAAW,CAAC,SAAS,EAAE,MAAM,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAClF,CAAC;IACJ,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=create-checkout-session.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-checkout-session.d.mts","sourceRoot":"","sources":["../../../src/tools/checkout/session/create-checkout-session.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,IAuElB,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-checkout-session.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-checkout-session.d.ts","sourceRoot":"","sources":["../../../src/tools/checkout/session/create-checkout-session.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,IAuElB,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"}