@henrylabs/mcp 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/filtering.d.mts +1 -0
  2. package/filtering.d.mts.map +1 -1
  3. package/filtering.d.ts +1 -0
  4. package/filtering.d.ts.map +1 -1
  5. package/filtering.js +4 -0
  6. package/filtering.js.map +1 -1
  7. package/filtering.mjs +3 -0
  8. package/filtering.mjs.map +1 -1
  9. package/package.json +3 -3
  10. package/server.js +1 -1
  11. package/server.mjs +1 -1
  12. package/src/filtering.ts +4 -0
  13. package/src/server.ts +1 -1
  14. package/src/tools/cart/create-cart-checkout.ts +10 -3
  15. package/src/tools/cart/items/add-cart-items.ts +10 -3
  16. package/src/tools/cart/items/clear-cart-items.ts +10 -3
  17. package/src/tools/cart/items/list-cart-items.ts +10 -3
  18. package/src/tools/cart/items/remove-cart-items.ts +10 -3
  19. package/src/tools/checkout/session/confirm-checkout-session.ts +12 -5
  20. package/src/tools/checkout/session/create-checkout-session.ts +10 -3
  21. package/src/tools/orders/retrieve-status-orders.ts +10 -3
  22. package/src/tools/products/retrieve-product-details.ts +3 -10
  23. package/src/tools/products/search-products.ts +43 -11
  24. package/src/tools/types.ts +12 -0
  25. package/src/tools/wallet/collect-payment-details.ts +10 -3
  26. package/tools/cart/create-cart-checkout.d.mts.map +1 -1
  27. package/tools/cart/create-cart-checkout.d.ts.map +1 -1
  28. package/tools/cart/create-cart-checkout.js +9 -1
  29. package/tools/cart/create-cart-checkout.js.map +1 -1
  30. package/tools/cart/create-cart-checkout.mjs +11 -3
  31. package/tools/cart/create-cart-checkout.mjs.map +1 -1
  32. package/tools/cart/items/add-cart-items.d.mts.map +1 -1
  33. package/tools/cart/items/add-cart-items.d.ts.map +1 -1
  34. package/tools/cart/items/add-cart-items.js +9 -1
  35. package/tools/cart/items/add-cart-items.js.map +1 -1
  36. package/tools/cart/items/add-cart-items.mjs +11 -3
  37. package/tools/cart/items/add-cart-items.mjs.map +1 -1
  38. package/tools/cart/items/clear-cart-items.d.mts.map +1 -1
  39. package/tools/cart/items/clear-cart-items.d.ts.map +1 -1
  40. package/tools/cart/items/clear-cart-items.js +9 -1
  41. package/tools/cart/items/clear-cart-items.js.map +1 -1
  42. package/tools/cart/items/clear-cart-items.mjs +11 -3
  43. package/tools/cart/items/clear-cart-items.mjs.map +1 -1
  44. package/tools/cart/items/list-cart-items.d.mts.map +1 -1
  45. package/tools/cart/items/list-cart-items.d.ts.map +1 -1
  46. package/tools/cart/items/list-cart-items.js +9 -1
  47. package/tools/cart/items/list-cart-items.js.map +1 -1
  48. package/tools/cart/items/list-cart-items.mjs +11 -3
  49. package/tools/cart/items/list-cart-items.mjs.map +1 -1
  50. package/tools/cart/items/remove-cart-items.d.mts.map +1 -1
  51. package/tools/cart/items/remove-cart-items.d.ts.map +1 -1
  52. package/tools/cart/items/remove-cart-items.js +9 -1
  53. package/tools/cart/items/remove-cart-items.js.map +1 -1
  54. package/tools/cart/items/remove-cart-items.mjs +11 -3
  55. package/tools/cart/items/remove-cart-items.mjs.map +1 -1
  56. package/tools/checkout/session/confirm-checkout-session.d.mts.map +1 -1
  57. package/tools/checkout/session/confirm-checkout-session.d.ts.map +1 -1
  58. package/tools/checkout/session/confirm-checkout-session.js +9 -1
  59. package/tools/checkout/session/confirm-checkout-session.js.map +1 -1
  60. package/tools/checkout/session/confirm-checkout-session.mjs +11 -3
  61. package/tools/checkout/session/confirm-checkout-session.mjs.map +1 -1
  62. package/tools/checkout/session/create-checkout-session.d.mts.map +1 -1
  63. package/tools/checkout/session/create-checkout-session.d.ts.map +1 -1
  64. package/tools/checkout/session/create-checkout-session.js +9 -1
  65. package/tools/checkout/session/create-checkout-session.js.map +1 -1
  66. package/tools/checkout/session/create-checkout-session.mjs +11 -3
  67. package/tools/checkout/session/create-checkout-session.mjs.map +1 -1
  68. package/tools/orders/retrieve-status-orders.d.mts.map +1 -1
  69. package/tools/orders/retrieve-status-orders.d.ts.map +1 -1
  70. package/tools/orders/retrieve-status-orders.js +9 -1
  71. package/tools/orders/retrieve-status-orders.js.map +1 -1
  72. package/tools/orders/retrieve-status-orders.mjs +11 -3
  73. package/tools/orders/retrieve-status-orders.mjs.map +1 -1
  74. package/tools/products/retrieve-product-details.d.mts.map +1 -1
  75. package/tools/products/retrieve-product-details.d.ts.map +1 -1
  76. package/tools/products/retrieve-product-details.js +3 -9
  77. package/tools/products/retrieve-product-details.js.map +1 -1
  78. package/tools/products/retrieve-product-details.mjs +3 -9
  79. package/tools/products/retrieve-product-details.mjs.map +1 -1
  80. package/tools/products/search-products.d.mts.map +1 -1
  81. package/tools/products/search-products.d.ts.map +1 -1
  82. package/tools/products/search-products.js +42 -9
  83. package/tools/products/search-products.js.map +1 -1
  84. package/tools/products/search-products.mjs +44 -11
  85. package/tools/products/search-products.mjs.map +1 -1
  86. package/tools/types.d.mts +1 -0
  87. package/tools/types.d.mts.map +1 -1
  88. package/tools/types.d.ts +1 -0
  89. package/tools/types.d.ts.map +1 -1
  90. package/tools/types.js +12 -0
  91. package/tools/types.js.map +1 -1
  92. package/tools/types.mjs +11 -0
  93. package/tools/types.mjs.map +1 -1
  94. package/tools/wallet/collect-payment-details.d.mts.map +1 -1
  95. package/tools/wallet/collect-payment-details.d.ts.map +1 -1
  96. package/tools/wallet/collect-payment-details.js +9 -1
  97. package/tools/wallet/collect-payment-details.js.map +1 -1
  98. package/tools/wallet/collect-payment-details.mjs +11 -3
  99. package/tools/wallet/collect-payment-details.mjs.map +1 -1
package/filtering.d.mts CHANGED
@@ -1,2 +1,3 @@
1
1
  export declare function maybeFilter(jqFilter: unknown | undefined, response: any): Promise<any>;
2
+ export declare function isJqError(error: any): error is Error;
2
3
  //# sourceMappingURL=filtering.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"filtering.d.mts","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAM5F"}
1
+ {"version":3,"file":"filtering.d.mts","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAM5F;AAMD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAEpD"}
package/filtering.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export declare function maybeFilter(jqFilter: unknown | undefined, response: any): Promise<any>;
2
+ export declare function isJqError(error: any): error is Error;
2
3
  //# sourceMappingURL=filtering.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"filtering.d.ts","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAM5F"}
1
+ {"version":3,"file":"filtering.d.ts","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAM5F;AAMD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAEpD"}
package/filtering.js CHANGED
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.maybeFilter = maybeFilter;
7
+ exports.isJqError = isJqError;
7
8
  // @ts-nocheck
8
9
  const jq_web_1 = __importDefault(require("jq-web"));
9
10
  async function maybeFilter(jqFilter, response) {
@@ -17,4 +18,7 @@ async function maybeFilter(jqFilter, response) {
17
18
  async function jq(json, jqFilter) {
18
19
  return (await jq_web_1.default).json(json, jqFilter);
19
20
  }
21
+ function isJqError(error) {
22
+ return error instanceof Error && 'stderr' in error;
23
+ }
20
24
  //# sourceMappingURL=filtering.js.map
package/filtering.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"filtering.js","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":";;;;;AAGA,kCAMC;AATD,cAAc;AACd,oDAA4B;AAErB,KAAK,UAAU,WAAW,CAAC,QAA6B,EAAE,QAAa;IAC5E,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC7C,OAAO,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC,IAAS,EAAE,QAAgB;IAC3C,OAAO,CAAC,MAAM,gBAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC"}
1
+ {"version":3,"file":"filtering.js","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":";;;;;AAGA,kCAMC;AAMD,8BAEC;AAjBD,cAAc;AACd,oDAA4B;AAErB,KAAK,UAAU,WAAW,CAAC,QAA6B,EAAE,QAAa;IAC5E,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC7C,OAAO,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC,IAAS,EAAE,QAAgB;IAC3C,OAAO,CAAC,MAAM,gBAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAED,SAAgB,SAAS,CAAC,KAAU;IAClC,OAAO,KAAK,YAAY,KAAK,IAAI,QAAQ,IAAI,KAAK,CAAC;AACrD,CAAC"}
package/filtering.mjs CHANGED
@@ -10,4 +10,7 @@ export async function maybeFilter(jqFilter, response) {
10
10
  async function jq(json, jqFilter) {
11
11
  return (await initJq).json(json, jqFilter);
12
12
  }
13
+ export function isJqError(error) {
14
+ return error instanceof Error && 'stderr' in error;
15
+ }
13
16
  //# sourceMappingURL=filtering.mjs.map
package/filtering.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"filtering.mjs","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"OACO,MAAM,MAAM,QAAQ;AAE3B,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAA6B,EAAE,QAAa;IAC5E,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC7C,OAAO,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC,IAAS,EAAE,QAAgB;IAC3C,OAAO,CAAC,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC"}
1
+ {"version":3,"file":"filtering.mjs","sourceRoot":"","sources":["src/filtering.ts"],"names":[],"mappings":"OACO,MAAM,MAAM,QAAQ;AAE3B,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAA6B,EAAE,QAAa;IAC5E,IAAI,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC7C,OAAO,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC,IAAS,EAAE,QAAgB;IAC3C,OAAO,CAAC,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAU;IAClC,OAAO,KAAK,YAAY,KAAK,IAAI,QAAQ,IAAI,KAAK,CAAC;AACrD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henrylabs/mcp",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "The official MCP Server for the Henry SDK API",
5
5
  "author": "Henry SDK <lawrence@henry.social>",
6
6
  "types": "./index.d.ts",
@@ -27,14 +27,14 @@
27
27
  "fix": "eslint --fix --ext ts,js ."
28
28
  },
29
29
  "dependencies": {
30
- "@henrylabs/sdk": "^0.10.0",
30
+ "@henrylabs/sdk": "^0.11.0",
31
31
  "@cloudflare/cabidela": "^0.2.4",
32
32
  "@modelcontextprotocol/sdk": "^1.11.5",
33
33
  "@valtown/deno-http-worker": "^0.0.21",
34
34
  "cors": "^2.8.5",
35
35
  "express": "^5.1.0",
36
36
  "fuse.js": "^7.1.0",
37
- "jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.6/jq-web.tar.gz",
37
+ "jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.8/jq-web.tar.gz",
38
38
  "qs": "^6.14.0",
39
39
  "typescript": "5.8.3",
40
40
  "yargs": "^17.7.2",
package/server.js CHANGED
@@ -22,7 +22,7 @@ var tools_2 = require("./tools.js");
22
22
  Object.defineProperty(exports, "endpoints", { enumerable: true, get: function () { return tools_2.endpoints; } });
23
23
  const newMcpServer = () => new mcp_js_1.McpServer({
24
24
  name: 'henrylabs_sdk_api',
25
- version: '0.10.0',
25
+ version: '0.11.0',
26
26
  }, { capabilities: { tools: {}, logging: {} } });
27
27
  exports.newMcpServer = newMcpServer;
28
28
  // Create server instance
package/server.mjs CHANGED
@@ -11,7 +11,7 @@ export { ClientType } from "./compat.mjs";
11
11
  export { endpoints } from "./tools.mjs";
12
12
  export const newMcpServer = () => new McpServer({
13
13
  name: 'henrylabs_sdk_api',
14
- version: '0.10.0',
14
+ version: '0.11.0',
15
15
  }, { capabilities: { tools: {}, logging: {} } });
16
16
  // Create server instance
17
17
  export const server = newMcpServer();
package/src/filtering.ts CHANGED
@@ -12,3 +12,7 @@ export async function maybeFilter(jqFilter: unknown | undefined, response: any):
12
12
  async function jq(json: any, jqFilter: string) {
13
13
  return (await initJq).json(json, jqFilter);
14
14
  }
15
+
16
+ export function isJqError(error: any): error is Error {
17
+ return error instanceof Error && 'stderr' in error;
18
+ }
package/src/server.ts CHANGED
@@ -34,7 +34,7 @@ export const newMcpServer = () =>
34
34
  new McpServer(
35
35
  {
36
36
  name: 'henrylabs_sdk_api',
37
- version: '0.10.0',
37
+ version: '0.11.0',
38
38
  },
39
39
  { capabilities: { tools: {}, logging: {} } },
40
40
  );
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from '@henrylabs/mcp/filtering';
4
- import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
3
+ import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import HenrySDK from '@henrylabs/sdk';
@@ -43,7 +43,14 @@ export const tool: Tool = {
43
43
 
44
44
  export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
45
45
  const { jq_filter, ...body } = args as any;
46
- return asTextContentResult(await maybeFilter(jq_filter, await client.cart.createCheckout(body)));
46
+ try {
47
+ return asTextContentResult(await maybeFilter(jq_filter, await client.cart.createCheckout(body)));
48
+ } catch (error) {
49
+ if (isJqError(error)) {
50
+ return asErrorResult(error.message);
51
+ }
52
+ throw error;
53
+ }
47
54
  };
48
55
 
49
56
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from '@henrylabs/mcp/filtering';
4
- import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
3
+ import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import HenrySDK from '@henrylabs/sdk';
@@ -87,7 +87,14 @@ export const tool: Tool = {
87
87
 
88
88
  export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
89
89
  const { jq_filter, ...body } = args as any;
90
- return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.add(body)));
90
+ try {
91
+ return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.add(body)));
92
+ } catch (error) {
93
+ if (isJqError(error)) {
94
+ return asErrorResult(error.message);
95
+ }
96
+ throw error;
97
+ }
91
98
  };
92
99
 
93
100
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from '@henrylabs/mcp/filtering';
4
- import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
3
+ import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import HenrySDK from '@henrylabs/sdk';
@@ -41,7 +41,14 @@ export const tool: Tool = {
41
41
 
42
42
  export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
43
43
  const { jq_filter, ...body } = args as any;
44
- return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.clear(body)));
44
+ try {
45
+ return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.clear(body)));
46
+ } catch (error) {
47
+ if (isJqError(error)) {
48
+ return asErrorResult(error.message);
49
+ }
50
+ throw error;
51
+ }
45
52
  };
46
53
 
47
54
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from '@henrylabs/mcp/filtering';
4
- import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
3
+ import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import HenrySDK from '@henrylabs/sdk';
@@ -41,7 +41,14 @@ export const tool: Tool = {
41
41
 
42
42
  export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
43
43
  const { jq_filter, ...body } = args as any;
44
- return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.list(body)));
44
+ try {
45
+ return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.list(body)));
46
+ } catch (error) {
47
+ if (isJqError(error)) {
48
+ return asErrorResult(error.message);
49
+ }
50
+ throw error;
51
+ }
45
52
  };
46
53
 
47
54
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from '@henrylabs/mcp/filtering';
4
- import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
3
+ import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import HenrySDK from '@henrylabs/sdk';
@@ -44,7 +44,14 @@ export const tool: Tool = {
44
44
 
45
45
  export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
46
46
  const { productId, jq_filter, ...body } = args as any;
47
- return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.remove(productId, body)));
47
+ try {
48
+ return asTextContentResult(await maybeFilter(jq_filter, await client.cart.items.remove(productId, body)));
49
+ } catch (error) {
50
+ if (isJqError(error)) {
51
+ return asErrorResult(error.message);
52
+ }
53
+ throw error;
54
+ }
48
55
  };
49
56
 
50
57
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from '@henrylabs/mcp/filtering';
4
- import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
3
+ import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import HenrySDK from '@henrylabs/sdk';
@@ -93,9 +93,16 @@ export const tool: Tool = {
93
93
 
94
94
  export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
95
95
  const { jq_filter, ...body } = args as any;
96
- return asTextContentResult(
97
- await maybeFilter(jq_filter, await client.checkout.session.confirmCheckout(body)),
98
- );
96
+ try {
97
+ return asTextContentResult(
98
+ await maybeFilter(jq_filter, await client.checkout.session.confirmCheckout(body)),
99
+ );
100
+ } catch (error) {
101
+ if (isJqError(error)) {
102
+ return asErrorResult(error.message);
103
+ }
104
+ throw error;
105
+ }
99
106
  };
100
107
 
101
108
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from '@henrylabs/mcp/filtering';
4
- import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
3
+ import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import HenrySDK from '@henrylabs/sdk';
@@ -90,7 +90,14 @@ export const tool: Tool = {
90
90
 
91
91
  export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
92
92
  const { jq_filter, ...body } = args as any;
93
- return asTextContentResult(await maybeFilter(jq_filter, await client.checkout.session.createQuote(body)));
93
+ try {
94
+ return asTextContentResult(await maybeFilter(jq_filter, await client.checkout.session.createQuote(body)));
95
+ } catch (error) {
96
+ if (isJqError(error)) {
97
+ return asErrorResult(error.message);
98
+ }
99
+ throw error;
100
+ }
94
101
  };
95
102
 
96
103
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from '@henrylabs/mcp/filtering';
4
- import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
3
+ import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import HenrySDK from '@henrylabs/sdk';
@@ -41,7 +41,14 @@ export const tool: Tool = {
41
41
 
42
42
  export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
43
43
  const { orderId, jq_filter, ...body } = args as any;
44
- return asTextContentResult(await maybeFilter(jq_filter, await client.orders.retrieveStatus(orderId)));
44
+ try {
45
+ return asTextContentResult(await maybeFilter(jq_filter, await client.orders.retrieveStatus(orderId)));
46
+ } catch (error) {
47
+ if (isJqError(error)) {
48
+ return asErrorResult(error.message);
49
+ }
50
+ throw error;
51
+ }
45
52
  };
46
53
 
47
54
  export default { metadata, tool, handler };
@@ -1,6 +1,5 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from '@henrylabs/mcp/filtering';
4
3
  import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
5
4
 
6
5
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
@@ -18,7 +17,7 @@ export const metadata: Metadata = {
18
17
  export const tool: Tool = {
19
18
  name: 'retrieve_product_details',
20
19
  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 comprehensive product details using a product ID from search results.\n\nMUST BE CALLED BEFORE adding items to cart - this is the only way to get the productLink required for cart operations.\n\nReturns:\n- Product title, brand, rating, review count\n- Stores array with name, price, shipping, total, and LINK for each retailer\n- Available variants (sizes, colors, etc.) with availability status\n- Thumbnail images (multiple angles)\n\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```",
20
+ 'Retrieve comprehensive product details using a product ID from search results.\n\nMUST BE CALLED BEFORE adding items to cart - this is the only way to get the productLink required for cart operations.\n\nReturns:\n- Product title, brand, rating, review count\n- Stores array with name, price, shipping, total, and LINK for each retailer\n- Available variants (sizes, colors, etc.) with availability status\n- Thumbnail images (multiple angles)\n',
22
21
  inputSchema: {
23
22
  type: 'object',
24
23
  properties: {
@@ -26,12 +25,6 @@ export const tool: Tool = {
26
25
  type: 'string',
27
26
  description: 'Product ID',
28
27
  },
29
- jq_filter: {
30
- type: 'string',
31
- title: 'jq Filter',
32
- description:
33
- 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
34
- },
35
28
  },
36
29
  required: ['productId'],
37
30
  },
@@ -41,8 +34,8 @@ export const tool: Tool = {
41
34
  };
42
35
 
43
36
  export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
44
- const { jq_filter, ...body } = args as any;
45
- return asTextContentResult(await maybeFilter(jq_filter, await client.products.retrieveDetails(body)));
37
+ const body = args as any;
38
+ return asTextContentResult(await client.products.retrieveDetails(body));
46
39
  };
47
40
 
48
41
  export default { metadata, tool, handler };
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from '@henrylabs/mcp/filtering';
4
- import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
3
+ import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import HenrySDK from '@henrylabs/sdk';
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
18
18
  export const tool: Tool = {
19
19
  name: 'search_products',
20
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\nSearch for products using keywords and filters (price range, color, size, gender, manufacturer, region).\n\nReturns basic product information:\n- Product ID (required for next step)\n- Name, price, currency, description\n- Thumbnail image URL\n\nYou MUST call retrieve_product_details() with each product's ID to get:\n- Actual store links for purchasing\n- All available variants\n- Detailed reviews and ratings\n- Price comparisons across stores\n\nRecommended flow:\n1. search_products(query, filters) - Get product IDs\n2. retrieve_product_details(productId) - Get store URLs and variants for each\n3. Present results with images, prices, AND clickable store links\n\nCommon filters: limit (default 10), greaterThanPrice, lowerThanPrice, color, size, gender\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/product_search_response',\n $defs: {\n product_search_response: {\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string'\n },\n currency: {\n type: 'string'\n },\n description: {\n type: 'string'\n },\n imageUrl: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n price: {\n type: 'number'\n },\n source: {\n type: 'string'\n },\n originalPrice: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'currency',\n 'description',\n 'imageUrl',\n 'name',\n 'price',\n 'source'\n ]\n }\n },\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'data',\n 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
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\nSearch for products using keywords and filters (price range, color, size, gender, manufacturer, region).\n\nReturns basic product information:\n- Product ID (required for next step)\n- Name, price, currency, description\n- Thumbnail image URL\n\nYou MUST call retrieve_product_details() with each product's ID to get:\n- Actual store links for purchasing\n- All available variants\n- Detailed reviews and ratings\n- Price comparisons across stores\n\nRecommended flow:\n1. search_products(query, filters) - Get product IDs\n2. retrieve_product_details(productId) - Get store URLs and variants for each\n3. Present results with images, prices, AND clickable store links\n\nCommon filters: limit (default 10), greaterThanPrice, lowerThanPrice, color, size, gender\n\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/product_search_response',\n $defs: {\n product_search_response: {\n type: 'object',\n properties: {\n data: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string'\n },\n currency: {\n type: 'string'\n },\n description: {\n type: 'string'\n },\n imageUrl: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n price: {\n type: 'number'\n },\n source: {\n type: 'string'\n },\n originalPrice: {\n type: 'string'\n }\n },\n required: [ 'id',\n 'currency',\n 'description',\n 'imageUrl',\n 'name',\n 'price',\n 'source'\n ]\n }\n },\n message: {\n type: 'string'\n },\n pagination: {\n type: 'object',\n properties: {\n nextCursor: {\n type: 'string'\n },\n previousCursor: {\n type: 'string'\n }\n },\n required: [ 'nextCursor',\n 'previousCursor'\n ]\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'data',\n 'message',\n 'pagination',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
22
22
  inputSchema: {
23
23
  type: 'object',
24
24
  properties: {
@@ -28,15 +28,23 @@ export const tool: Tool = {
28
28
  },
29
29
  color: {
30
30
  type: 'string',
31
- description: 'Color',
31
+ description: '[Deprecated] Filter results by color',
32
+ },
33
+ cursor: {
34
+ type: 'integer',
35
+ description: 'Cursor returned from the previous response (SerpAPI start param)',
36
+ },
37
+ freeShipping: {
38
+ type: 'boolean',
39
+ description: 'Restrict results to listings with free shipping',
32
40
  },
33
41
  gender: {
34
42
  type: 'string',
35
- description: 'Gender',
43
+ description: '[Deprecated] Filter results by gender',
36
44
  },
37
45
  greaterThanPrice: {
38
46
  type: 'number',
39
- description: 'Greater than price',
47
+ description: '[Deprecated] Alias for minPrice. Maintained for backwards compatibility.',
40
48
  },
41
49
  limit: {
42
50
  type: 'integer',
@@ -44,19 +52,36 @@ export const tool: Tool = {
44
52
  },
45
53
  lowerThanPrice: {
46
54
  type: 'number',
47
- description: 'Lower than price',
55
+ description: '[Deprecated] Alias for maxPrice. Maintained for backwards compatibility.',
48
56
  },
49
57
  manufacturer: {
50
58
  type: 'string',
51
- description: 'Manufacturer',
59
+ description: '[Deprecated] Filter results by manufacturer',
60
+ },
61
+ maxPrice: {
62
+ type: 'number',
63
+ description: 'Maximum price filter',
64
+ },
65
+ minPrice: {
66
+ type: 'number',
67
+ description: 'Minimum price filter',
52
68
  },
53
69
  region: {
54
70
  type: 'string',
55
- description: 'Region',
71
+ description: '[Deprecated] Region filter (defaults to `us`).',
56
72
  },
57
73
  size: {
58
74
  type: 'string',
59
- description: 'Size',
75
+ description: '[Deprecated] Filter results by size',
76
+ },
77
+ smallBusiness: {
78
+ type: 'boolean',
79
+ description: 'Restrict results to merchants labeled as small business',
80
+ },
81
+ sortBy: {
82
+ type: 'string',
83
+ description: 'Sort order: 1 = price low→high, 2 = price high→low',
84
+ enum: [1, 2],
60
85
  },
61
86
  jq_filter: {
62
87
  type: 'string',
@@ -72,7 +97,14 @@ export const tool: Tool = {
72
97
 
73
98
  export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
74
99
  const { jq_filter, ...body } = args as any;
75
- return asTextContentResult(await maybeFilter(jq_filter, await client.products.search(body)));
100
+ try {
101
+ return asTextContentResult(await maybeFilter(jq_filter, await client.products.search(body)));
102
+ } catch (error) {
103
+ if (isJqError(error)) {
104
+ return asErrorResult(error.message);
105
+ }
106
+ throw error;
107
+ }
76
108
  };
77
109
 
78
110
  export default { metadata, tool, handler };
@@ -87,6 +87,18 @@ export async function asBinaryContentResult(response: Response): Promise<ToolCal
87
87
  }
88
88
  }
89
89
 
90
+ export function asErrorResult(message: string): ToolCallResult {
91
+ return {
92
+ content: [
93
+ {
94
+ type: 'text',
95
+ text: message,
96
+ },
97
+ ],
98
+ isError: true,
99
+ };
100
+ }
101
+
90
102
  export type Metadata = {
91
103
  resource: string;
92
104
  operation: 'read' | 'write';
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { maybeFilter } from '@henrylabs/mcp/filtering';
4
- import { Metadata, asTextContentResult } from '@henrylabs/mcp/tools/types';
3
+ import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
4
+ import { Metadata, asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
5
5
 
6
6
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
7
  import HenrySDK from '@henrylabs/sdk';
@@ -43,7 +43,14 @@ export const tool: Tool = {
43
43
 
44
44
  export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
45
45
  const { jq_filter, ...body } = args as any;
46
- return asTextContentResult(await maybeFilter(jq_filter, await client.wallet.createCardCollection(body)));
46
+ try {
47
+ return asTextContentResult(await maybeFilter(jq_filter, await client.wallet.createCardCollection(body)));
48
+ } catch (error) {
49
+ if (isJqError(error)) {
50
+ return asErrorResult(error.message);
51
+ }
52
+ throw error;
53
+ }
47
54
  };
48
55
 
49
56
  export default { metadata, tool, handler };
@@ -1 +1 @@
1
- {"version":3,"file":"create-cart-checkout.d.mts","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAuB,MAAM,4BAA4B;OAEnE,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,iEAGxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAKzF,wBAA2C"}
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 +1 @@
1
- {"version":3,"file":"create-cart-checkout.d.ts","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":"OAGO,EAAE,QAAQ,EAAuB,MAAM,4BAA4B;OAEnE,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,iEAGxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAKzF,wBAA2C"}
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"}
@@ -37,7 +37,15 @@ exports.tool = {
37
37
  };
38
38
  const handler = async (client, args) => {
39
39
  const { jq_filter, ...body } = args;
40
- return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.cart.createCheckout(body)));
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
+ }
41
49
  };
42
50
  exports.handler = handler;
43
51
  exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
@@ -1 +1 @@
1
- {"version":3,"file":"create-cart-checkout.js","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAuD;AACvD,sDAA2E;AAK9D,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,QAAQ,CAAC;IAChB,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,OAAO,IAAA,2BAAmB,EAAC,MAAM,IAAA,uBAAW,EAAC,SAAS,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACnG,CAAC,CAAC;AAHW,QAAA,OAAO,WAGlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
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AC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAVW,QAAA,OAAO,WAUlB;AAEF,kBAAe,EAAE,QAAQ,EAAR,gBAAQ,EAAE,IAAI,EAAJ,YAAI,EAAE,OAAO,EAAP,eAAO,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { maybeFilter } from '@henrylabs/mcp/filtering';
3
- import { asTextContentResult } from '@henrylabs/mcp/tools/types';
2
+ import { isJqError, maybeFilter } from '@henrylabs/mcp/filtering';
3
+ import { asErrorResult, asTextContentResult } from '@henrylabs/mcp/tools/types';
4
4
  export const metadata = {
5
5
  resource: 'cart',
6
6
  operation: 'write',
@@ -34,7 +34,15 @@ export const tool = {
34
34
  };
35
35
  export const handler = async (client, args) => {
36
36
  const { jq_filter, ...body } = args;
37
- return asTextContentResult(await maybeFilter(jq_filter, await client.cart.createCheckout(body)));
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
+ }
38
46
  };
39
47
  export default { metadata, tool, handler };
40
48
  //# sourceMappingURL=create-cart-checkout.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-cart-checkout.mjs","sourceRoot":"","sources":["../../src/tools/cart/create-cart-checkout.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC/C,EAAY,mBAAmB,EAAE,MAAM,4BAA4B;AAK1E,MAAM,CAAC,MAAM,QAAQ,GAAa;IAChC,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,CAAC,QAAQ,CAAC;IAChB,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,gBAAgB;IAC1B,WAAW,EAAE,0BAA0B;C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AQ,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,iEAGxF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAHoC,QAAQ,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;;AAKzF,wBAA2C"}
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"}