@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.
Files changed (315) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +255 -0
  3. package/code-tool-paths.cjs +6 -0
  4. package/code-tool-paths.cjs.map +1 -0
  5. package/code-tool-paths.d.cts +2 -0
  6. package/code-tool-paths.d.cts.map +1 -0
  7. package/code-tool-types.d.mts +14 -0
  8. package/code-tool-types.d.mts.map +1 -0
  9. package/code-tool-types.d.ts +14 -0
  10. package/code-tool-types.d.ts.map +1 -0
  11. package/code-tool-types.js +4 -0
  12. package/code-tool-types.js.map +1 -0
  13. package/code-tool-types.mjs +3 -0
  14. package/code-tool-types.mjs.map +1 -0
  15. package/code-tool-worker.d.mts +5 -0
  16. package/code-tool-worker.d.mts.map +1 -0
  17. package/code-tool-worker.d.ts +5 -0
  18. package/code-tool-worker.d.ts.map +1 -0
  19. package/code-tool-worker.js +45 -0
  20. package/code-tool-worker.js.map +1 -0
  21. package/code-tool-worker.mjs +40 -0
  22. package/code-tool-worker.mjs.map +1 -0
  23. package/code-tool.d.mts +12 -0
  24. package/code-tool.d.mts.map +1 -0
  25. package/code-tool.d.ts +12 -0
  26. package/code-tool.d.ts.map +1 -0
  27. package/code-tool.js +158 -0
  28. package/code-tool.js.map +1 -0
  29. package/code-tool.mjs +122 -0
  30. package/code-tool.mjs.map +1 -0
  31. package/compat.d.mts +58 -0
  32. package/compat.d.mts.map +1 -0
  33. package/compat.d.ts +58 -0
  34. package/compat.d.ts.map +1 -0
  35. package/compat.js +387 -0
  36. package/compat.js.map +1 -0
  37. package/compat.mjs +378 -0
  38. package/compat.mjs.map +1 -0
  39. package/docs-search-tool.d.mts +44 -0
  40. package/docs-search-tool.d.mts.map +1 -0
  41. package/docs-search-tool.d.ts +44 -0
  42. package/docs-search-tool.d.ts.map +1 -0
  43. package/docs-search-tool.js +43 -0
  44. package/docs-search-tool.js.map +1 -0
  45. package/docs-search-tool.mjs +39 -0
  46. package/docs-search-tool.mjs.map +1 -0
  47. package/dynamic-tools.d.mts +12 -0
  48. package/dynamic-tools.d.mts.map +1 -0
  49. package/dynamic-tools.d.ts +12 -0
  50. package/dynamic-tools.d.ts.map +1 -0
  51. package/dynamic-tools.js +135 -0
  52. package/dynamic-tools.js.map +1 -0
  53. package/dynamic-tools.mjs +132 -0
  54. package/dynamic-tools.mjs.map +1 -0
  55. package/filtering.d.mts +2 -0
  56. package/filtering.d.mts.map +1 -0
  57. package/filtering.d.ts +2 -0
  58. package/filtering.d.ts.map +1 -0
  59. package/filtering.js +20 -0
  60. package/filtering.js.map +1 -0
  61. package/filtering.mjs +13 -0
  62. package/filtering.mjs.map +1 -0
  63. package/headers.d.mts +4 -0
  64. package/headers.d.mts.map +1 -0
  65. package/headers.d.ts +4 -0
  66. package/headers.d.ts.map +1 -0
  67. package/headers.js +13 -0
  68. package/headers.js.map +1 -0
  69. package/headers.mjs +9 -0
  70. package/headers.mjs.map +1 -0
  71. package/http.d.mts +9 -0
  72. package/http.d.mts.map +1 -0
  73. package/http.d.ts +9 -0
  74. package/http.d.ts.map +1 -0
  75. package/http.js +108 -0
  76. package/http.js.map +1 -0
  77. package/http.mjs +100 -0
  78. package/http.mjs.map +1 -0
  79. package/index.d.mts +3 -0
  80. package/index.d.mts.map +1 -0
  81. package/index.d.ts +3 -0
  82. package/index.d.ts.map +1 -0
  83. package/index.js +91 -0
  84. package/index.js.map +1 -0
  85. package/index.mjs +89 -0
  86. package/index.mjs.map +1 -0
  87. package/options.d.mts +20 -0
  88. package/options.d.mts.map +1 -0
  89. package/options.d.ts +20 -0
  90. package/options.d.ts.map +1 -0
  91. package/options.js +424 -0
  92. package/options.js.map +1 -0
  93. package/options.mjs +417 -0
  94. package/options.mjs.map +1 -0
  95. package/package.json +216 -0
  96. package/server.d.mts +35 -0
  97. package/server.d.mts.map +1 -0
  98. package/server.d.ts +35 -0
  99. package/server.d.ts.map +1 -0
  100. package/server.js +175 -0
  101. package/server.js.map +1 -0
  102. package/server.mjs +161 -0
  103. package/server.mjs.map +1 -0
  104. package/src/code-tool-paths.cts +3 -0
  105. package/src/code-tool-types.ts +14 -0
  106. package/src/code-tool-worker.ts +46 -0
  107. package/src/code-tool.ts +147 -0
  108. package/src/compat.ts +483 -0
  109. package/src/docs-search-tool.ts +48 -0
  110. package/src/dynamic-tools.ts +153 -0
  111. package/src/filtering.ts +14 -0
  112. package/src/headers.ts +14 -0
  113. package/src/http.ts +127 -0
  114. package/src/index.ts +108 -0
  115. package/src/options.ts +466 -0
  116. package/src/server.ts +208 -0
  117. package/src/stdio.ts +13 -0
  118. package/src/tools/cart/create-checkout-cart.ts +49 -0
  119. package/src/tools/cart/items/add-cart-items.ts +93 -0
  120. package/src/tools/cart/items/clear-cart-items.ts +47 -0
  121. package/src/tools/cart/items/list-cart-items.ts +47 -0
  122. package/src/tools/cart/items/remove-cart-items.ts +50 -0
  123. package/src/tools/checkout/session/confirm-checkout-checkout-session.ts +101 -0
  124. package/src/tools/checkout/session/create-quote-checkout-session.ts +96 -0
  125. package/src/tools/checkout/session/list-products-checkout-session.ts +47 -0
  126. package/src/tools/checkout/session/retrieve-shipping-info-checkout-session.ts +49 -0
  127. package/src/tools/index.ts +105 -0
  128. package/src/tools/merchants/check-status-merchants.ts +56 -0
  129. package/src/tools/merchants/get-shipping-info-merchants.ts +60 -0
  130. package/src/tools/merchants/list-supported-merchants.ts +52 -0
  131. package/src/tools/orders/retrieve-status-orders.ts +47 -0
  132. package/src/tools/products/retrieve-details-products.ts +48 -0
  133. package/src/tools/products/search-products.ts +78 -0
  134. package/src/tools/products/variant-check/create-products-variant-check.ts +85 -0
  135. package/src/tools/products/variant-check/retrieve-status-products-variant-check.ts +50 -0
  136. package/src/tools/types.ts +103 -0
  137. package/src/tools/wallet/create-card-collection-wallet.ts +49 -0
  138. package/src/tools.ts +1 -0
  139. package/src/tsconfig.json +11 -0
  140. package/stdio.d.mts +3 -0
  141. package/stdio.d.mts.map +1 -0
  142. package/stdio.d.ts +3 -0
  143. package/stdio.d.ts.map +1 -0
  144. package/stdio.js +14 -0
  145. package/stdio.js.map +1 -0
  146. package/stdio.mjs +10 -0
  147. package/stdio.mjs.map +1 -0
  148. package/tools/cart/create-checkout-cart.d.mts +45 -0
  149. package/tools/cart/create-checkout-cart.d.mts.map +1 -0
  150. package/tools/cart/create-checkout-cart.d.ts +45 -0
  151. package/tools/cart/create-checkout-cart.d.ts.map +1 -0
  152. package/tools/cart/create-checkout-cart.js +44 -0
  153. package/tools/cart/create-checkout-cart.js.map +1 -0
  154. package/tools/cart/create-checkout-cart.mjs +40 -0
  155. package/tools/cart/create-checkout-cart.mjs.map +1 -0
  156. package/tools/cart/items/add-cart-items.d.mts +45 -0
  157. package/tools/cart/items/add-cart-items.d.mts.map +1 -0
  158. package/tools/cart/items/add-cart-items.d.ts +45 -0
  159. package/tools/cart/items/add-cart-items.d.ts.map +1 -0
  160. package/tools/cart/items/add-cart-items.js +86 -0
  161. package/tools/cart/items/add-cart-items.js.map +1 -0
  162. package/tools/cart/items/add-cart-items.mjs +82 -0
  163. package/tools/cart/items/add-cart-items.mjs.map +1 -0
  164. package/tools/cart/items/clear-cart-items.d.mts +45 -0
  165. package/tools/cart/items/clear-cart-items.d.mts.map +1 -0
  166. package/tools/cart/items/clear-cart-items.d.ts +45 -0
  167. package/tools/cart/items/clear-cart-items.d.ts.map +1 -0
  168. package/tools/cart/items/clear-cart-items.js +42 -0
  169. package/tools/cart/items/clear-cart-items.js.map +1 -0
  170. package/tools/cart/items/clear-cart-items.mjs +38 -0
  171. package/tools/cart/items/clear-cart-items.mjs.map +1 -0
  172. package/tools/cart/items/list-cart-items.d.mts +45 -0
  173. package/tools/cart/items/list-cart-items.d.mts.map +1 -0
  174. package/tools/cart/items/list-cart-items.d.ts +45 -0
  175. package/tools/cart/items/list-cart-items.d.ts.map +1 -0
  176. package/tools/cart/items/list-cart-items.js +42 -0
  177. package/tools/cart/items/list-cart-items.js.map +1 -0
  178. package/tools/cart/items/list-cart-items.mjs +38 -0
  179. package/tools/cart/items/list-cart-items.mjs.map +1 -0
  180. package/tools/cart/items/remove-cart-items.d.mts +45 -0
  181. package/tools/cart/items/remove-cart-items.d.mts.map +1 -0
  182. package/tools/cart/items/remove-cart-items.d.ts +45 -0
  183. package/tools/cart/items/remove-cart-items.d.ts.map +1 -0
  184. package/tools/cart/items/remove-cart-items.js +45 -0
  185. package/tools/cart/items/remove-cart-items.js.map +1 -0
  186. package/tools/cart/items/remove-cart-items.mjs +41 -0
  187. package/tools/cart/items/remove-cart-items.mjs.map +1 -0
  188. package/tools/checkout/session/confirm-checkout-checkout-session.d.mts +45 -0
  189. package/tools/checkout/session/confirm-checkout-checkout-session.d.mts.map +1 -0
  190. package/tools/checkout/session/confirm-checkout-checkout-session.d.ts +45 -0
  191. package/tools/checkout/session/confirm-checkout-checkout-session.d.ts.map +1 -0
  192. package/tools/checkout/session/confirm-checkout-checkout-session.js +94 -0
  193. package/tools/checkout/session/confirm-checkout-checkout-session.js.map +1 -0
  194. package/tools/checkout/session/confirm-checkout-checkout-session.mjs +90 -0
  195. package/tools/checkout/session/confirm-checkout-checkout-session.mjs.map +1 -0
  196. package/tools/checkout/session/create-quote-checkout-session.d.mts +45 -0
  197. package/tools/checkout/session/create-quote-checkout-session.d.mts.map +1 -0
  198. package/tools/checkout/session/create-quote-checkout-session.d.ts +45 -0
  199. package/tools/checkout/session/create-quote-checkout-session.d.ts.map +1 -0
  200. package/tools/checkout/session/create-quote-checkout-session.js +91 -0
  201. package/tools/checkout/session/create-quote-checkout-session.js.map +1 -0
  202. package/tools/checkout/session/create-quote-checkout-session.mjs +87 -0
  203. package/tools/checkout/session/create-quote-checkout-session.mjs.map +1 -0
  204. package/tools/checkout/session/list-products-checkout-session.d.mts +45 -0
  205. package/tools/checkout/session/list-products-checkout-session.d.mts.map +1 -0
  206. package/tools/checkout/session/list-products-checkout-session.d.ts +45 -0
  207. package/tools/checkout/session/list-products-checkout-session.d.ts.map +1 -0
  208. package/tools/checkout/session/list-products-checkout-session.js +42 -0
  209. package/tools/checkout/session/list-products-checkout-session.js.map +1 -0
  210. package/tools/checkout/session/list-products-checkout-session.mjs +38 -0
  211. package/tools/checkout/session/list-products-checkout-session.mjs.map +1 -0
  212. package/tools/checkout/session/retrieve-shipping-info-checkout-session.d.mts +45 -0
  213. package/tools/checkout/session/retrieve-shipping-info-checkout-session.d.mts.map +1 -0
  214. package/tools/checkout/session/retrieve-shipping-info-checkout-session.d.ts +45 -0
  215. package/tools/checkout/session/retrieve-shipping-info-checkout-session.d.ts.map +1 -0
  216. package/tools/checkout/session/retrieve-shipping-info-checkout-session.js +42 -0
  217. package/tools/checkout/session/retrieve-shipping-info-checkout-session.js.map +1 -0
  218. package/tools/checkout/session/retrieve-shipping-info-checkout-session.mjs +38 -0
  219. package/tools/checkout/session/retrieve-shipping-info-checkout-session.mjs.map +1 -0
  220. package/tools/index.d.mts +10 -0
  221. package/tools/index.d.mts.map +1 -0
  222. package/tools/index.d.ts +10 -0
  223. package/tools/index.d.ts.map +1 -0
  224. package/tools/index.js +89 -0
  225. package/tools/index.js.map +1 -0
  226. package/tools/index.mjs +82 -0
  227. package/tools/index.mjs.map +1 -0
  228. package/tools/merchants/check-status-merchants.d.mts +45 -0
  229. package/tools/merchants/check-status-merchants.d.mts.map +1 -0
  230. package/tools/merchants/check-status-merchants.d.ts +45 -0
  231. package/tools/merchants/check-status-merchants.d.ts.map +1 -0
  232. package/tools/merchants/check-status-merchants.js +48 -0
  233. package/tools/merchants/check-status-merchants.js.map +1 -0
  234. package/tools/merchants/check-status-merchants.mjs +44 -0
  235. package/tools/merchants/check-status-merchants.mjs.map +1 -0
  236. package/tools/merchants/get-shipping-info-merchants.d.mts +45 -0
  237. package/tools/merchants/get-shipping-info-merchants.d.mts.map +1 -0
  238. package/tools/merchants/get-shipping-info-merchants.d.ts +45 -0
  239. package/tools/merchants/get-shipping-info-merchants.d.ts.map +1 -0
  240. package/tools/merchants/get-shipping-info-merchants.js +55 -0
  241. package/tools/merchants/get-shipping-info-merchants.js.map +1 -0
  242. package/tools/merchants/get-shipping-info-merchants.mjs +51 -0
  243. package/tools/merchants/get-shipping-info-merchants.mjs.map +1 -0
  244. package/tools/merchants/list-supported-merchants.d.mts +45 -0
  245. package/tools/merchants/list-supported-merchants.d.mts.map +1 -0
  246. package/tools/merchants/list-supported-merchants.d.ts +45 -0
  247. package/tools/merchants/list-supported-merchants.d.ts.map +1 -0
  248. package/tools/merchants/list-supported-merchants.js +47 -0
  249. package/tools/merchants/list-supported-merchants.js.map +1 -0
  250. package/tools/merchants/list-supported-merchants.mjs +43 -0
  251. package/tools/merchants/list-supported-merchants.mjs.map +1 -0
  252. package/tools/orders/retrieve-status-orders.d.mts +45 -0
  253. package/tools/orders/retrieve-status-orders.d.mts.map +1 -0
  254. package/tools/orders/retrieve-status-orders.d.ts +45 -0
  255. package/tools/orders/retrieve-status-orders.d.ts.map +1 -0
  256. package/tools/orders/retrieve-status-orders.js +42 -0
  257. package/tools/orders/retrieve-status-orders.js.map +1 -0
  258. package/tools/orders/retrieve-status-orders.mjs +38 -0
  259. package/tools/orders/retrieve-status-orders.mjs.map +1 -0
  260. package/tools/products/retrieve-details-products.d.mts +45 -0
  261. package/tools/products/retrieve-details-products.d.mts.map +1 -0
  262. package/tools/products/retrieve-details-products.d.ts +45 -0
  263. package/tools/products/retrieve-details-products.d.ts.map +1 -0
  264. package/tools/products/retrieve-details-products.js +43 -0
  265. package/tools/products/retrieve-details-products.js.map +1 -0
  266. package/tools/products/retrieve-details-products.mjs +39 -0
  267. package/tools/products/retrieve-details-products.mjs.map +1 -0
  268. package/tools/products/search-products.d.mts +45 -0
  269. package/tools/products/search-products.d.mts.map +1 -0
  270. package/tools/products/search-products.d.ts +45 -0
  271. package/tools/products/search-products.d.ts.map +1 -0
  272. package/tools/products/search-products.js +73 -0
  273. package/tools/products/search-products.js.map +1 -0
  274. package/tools/products/search-products.mjs +69 -0
  275. package/tools/products/search-products.mjs.map +1 -0
  276. package/tools/products/variant-check/create-products-variant-check.d.mts +45 -0
  277. package/tools/products/variant-check/create-products-variant-check.d.mts.map +1 -0
  278. package/tools/products/variant-check/create-products-variant-check.d.ts +45 -0
  279. package/tools/products/variant-check/create-products-variant-check.d.ts.map +1 -0
  280. package/tools/products/variant-check/create-products-variant-check.js +79 -0
  281. package/tools/products/variant-check/create-products-variant-check.js.map +1 -0
  282. package/tools/products/variant-check/create-products-variant-check.mjs +75 -0
  283. package/tools/products/variant-check/create-products-variant-check.mjs.map +1 -0
  284. package/tools/products/variant-check/retrieve-status-products-variant-check.d.mts +45 -0
  285. package/tools/products/variant-check/retrieve-status-products-variant-check.d.mts.map +1 -0
  286. package/tools/products/variant-check/retrieve-status-products-variant-check.d.ts +45 -0
  287. package/tools/products/variant-check/retrieve-status-products-variant-check.d.ts.map +1 -0
  288. package/tools/products/variant-check/retrieve-status-products-variant-check.js +43 -0
  289. package/tools/products/variant-check/retrieve-status-products-variant-check.js.map +1 -0
  290. package/tools/products/variant-check/retrieve-status-products-variant-check.mjs +39 -0
  291. package/tools/products/variant-check/retrieve-status-products-variant-check.mjs.map +1 -0
  292. package/tools/types.d.mts +51 -0
  293. package/tools/types.d.mts.map +1 -0
  294. package/tools/types.d.ts +51 -0
  295. package/tools/types.d.ts.map +1 -0
  296. package/tools/types.js +46 -0
  297. package/tools/types.js.map +1 -0
  298. package/tools/types.mjs +42 -0
  299. package/tools/types.mjs.map +1 -0
  300. package/tools/wallet/create-card-collection-wallet.d.mts +45 -0
  301. package/tools/wallet/create-card-collection-wallet.d.mts.map +1 -0
  302. package/tools/wallet/create-card-collection-wallet.d.ts +45 -0
  303. package/tools/wallet/create-card-collection-wallet.d.ts.map +1 -0
  304. package/tools/wallet/create-card-collection-wallet.js +44 -0
  305. package/tools/wallet/create-card-collection-wallet.js.map +1 -0
  306. package/tools/wallet/create-card-collection-wallet.mjs +40 -0
  307. package/tools/wallet/create-card-collection-wallet.mjs.map +1 -0
  308. package/tools.d.mts +2 -0
  309. package/tools.d.mts.map +1 -0
  310. package/tools.d.ts +2 -0
  311. package/tools.d.ts.map +1 -0
  312. package/tools.js +18 -0
  313. package/tools.js.map +1 -0
  314. package/tools.mjs +2 -0
  315. package/tools.mjs.map +1 -0
@@ -0,0 +1,78 @@
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: 'write',
12
+ tags: [],
13
+ httpMethod: 'post',
14
+ httpPath: '/products/search',
15
+ operationId: 'searchProducts',
16
+ };
17
+
18
+ export const tool: Tool = {
19
+ name: 'search_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\nSearch for products using keyword and passing various filters and criteria\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 productLink: {\n type: 'string'\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 'productLink',\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```",
22
+ inputSchema: {
23
+ type: 'object',
24
+ properties: {
25
+ query: {
26
+ type: 'string',
27
+ description: 'Search query',
28
+ },
29
+ color: {
30
+ type: 'string',
31
+ description: 'Color',
32
+ },
33
+ gender: {
34
+ type: 'string',
35
+ description: 'Gender',
36
+ },
37
+ greaterThanPrice: {
38
+ type: 'number',
39
+ description: 'Greater than price',
40
+ },
41
+ limit: {
42
+ type: 'integer',
43
+ description: 'Limit the number of results',
44
+ },
45
+ lowerThanPrice: {
46
+ type: 'number',
47
+ description: 'Lower than price',
48
+ },
49
+ manufacturer: {
50
+ type: 'string',
51
+ description: 'Manufacturer',
52
+ },
53
+ region: {
54
+ type: 'string',
55
+ description: 'Region',
56
+ },
57
+ size: {
58
+ type: 'string',
59
+ description: 'Size',
60
+ },
61
+ jq_filter: {
62
+ type: 'string',
63
+ title: 'jq Filter',
64
+ description:
65
+ '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/).',
66
+ },
67
+ },
68
+ required: ['query'],
69
+ },
70
+ annotations: {},
71
+ };
72
+
73
+ export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
74
+ const { jq_filter, ...body } = args as any;
75
+ return asTextContentResult(await maybeFilter(jq_filter, await client.products.search(body)));
76
+ };
77
+
78
+ export default { metadata, tool, handler };
@@ -0,0 +1,85 @@
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.variant_check',
11
+ operation: 'write',
12
+ tags: [],
13
+ httpMethod: 'post',
14
+ httpPath: '/products/variant-check',
15
+ operationId: 'checkProductVariant',
16
+ };
17
+
18
+ export const tool: Tool = {
19
+ name: 'create_products_variant_check',
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\n! *This endpoint is experimental and unstable. The API contract may change without notice.*\n\nCreates a request to check if a specific product variant combination is in stock. Returns immediately with a request ID that can be used to poll for results.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/variant_check_create_response',\n $defs: {\n variant_check_create_response: {\n type: 'object',\n properties: {\n createdAt: {\n type: 'string'\n },\n message: {\n type: 'string'\n },\n requestId: {\n type: 'string'\n },\n status: {\n type: 'string',\n enum: [ 'pending',\n 'processing'\n ]\n },\n success: {\n type: 'boolean'\n }\n },\n required: [ 'createdAt',\n 'message',\n 'requestId',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
22
+ inputSchema: {
23
+ type: 'object',
24
+ properties: {
25
+ product: {
26
+ type: 'object',
27
+ description: 'Product details to check variant availability for',
28
+ properties: {
29
+ affiliateProductLink: {
30
+ type: 'string',
31
+ description:
32
+ 'Affiliate product link (if provided, will be used instead of productLink for order fulfillment)',
33
+ },
34
+ metadata: {
35
+ type: 'object',
36
+ description: 'Product metadata',
37
+ additionalProperties: true,
38
+ },
39
+ name: {
40
+ type: 'string',
41
+ description: 'Product name',
42
+ },
43
+ price: {
44
+ type: 'string',
45
+ description: 'Product price',
46
+ },
47
+ productId: {
48
+ type: 'string',
49
+ description: 'Product Id',
50
+ },
51
+ productImageLink: {
52
+ type: 'string',
53
+ description: 'Product image link (thumbnail)',
54
+ },
55
+ productLink: {
56
+ type: 'string',
57
+ description: 'Product link',
58
+ },
59
+ quantity: {
60
+ type: 'number',
61
+ description: 'Quantity',
62
+ },
63
+ },
64
+ },
65
+ 'x-user-id': {
66
+ type: 'string',
67
+ },
68
+ jq_filter: {
69
+ type: 'string',
70
+ title: 'jq Filter',
71
+ description:
72
+ '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/).',
73
+ },
74
+ },
75
+ required: ['product'],
76
+ },
77
+ annotations: {},
78
+ };
79
+
80
+ export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
81
+ const { jq_filter, ...body } = args as any;
82
+ return asTextContentResult(await maybeFilter(jq_filter, await client.products.variantCheck.create(body)));
83
+ };
84
+
85
+ export default { metadata, tool, handler };
@@ -0,0 +1,50 @@
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.variant_check',
11
+ operation: 'read',
12
+ tags: [],
13
+ httpMethod: 'get',
14
+ httpPath: '/products/variant-check/{id}',
15
+ operationId: 'getVariantCheckStatus',
16
+ };
17
+
18
+ export const tool: Tool = {
19
+ name: 'retrieve_status_products_variant_check',
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\n! *This endpoint is experimental and unstable. The API contract may change without notice.*\n\nPoll the status of a variant availability check request. Returns the current status and results if completed.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/variant_check_retrieve_status_response',\n $defs: {\n variant_check_retrieve_status_response: {\n type: 'object',\n properties: {\n createdAt: {\n type: 'string'\n },\n message: {\n type: 'string'\n },\n requestId: {\n type: 'string'\n },\n status: {\n type: 'string',\n enum: [ 'pending',\n 'processing',\n 'completed',\n 'failed',\n 'timeout'\n ]\n },\n success: {\n type: 'boolean'\n },\n updatedAt: {\n type: 'string'\n },\n completedAt: {\n type: 'string'\n },\n data: {\n type: 'object',\n properties: {\n apiVersion: {\n type: 'string'\n },\n executionTime: {\n type: 'string'\n },\n productName: {\n type: 'string'\n },\n requestedVariant: {\n type: 'object',\n additionalProperties: true\n },\n requestTime: {\n type: 'string'\n },\n stockStatus: {\n type: 'object',\n properties: {\n available: {\n type: 'boolean'\n },\n details: {\n type: 'object',\n additionalProperties: true\n },\n message: {\n type: 'string'\n }\n },\n required: [ 'available',\n 'details',\n 'message'\n ]\n },\n timestamp: {\n type: 'string'\n },\n totalExecutionTime: {\n type: 'string'\n },\n url: {\n type: 'string'\n }\n },\n required: [ 'apiVersion',\n 'executionTime',\n 'productName',\n 'requestedVariant',\n 'requestTime',\n 'stockStatus',\n 'timestamp',\n 'totalExecutionTime',\n 'url'\n ]\n },\n errorMessage: {\n type: 'string'\n },\n executionTimeMs: {\n type: 'number'\n },\n productLink: {\n type: 'string'\n },\n requestedVariant: {\n type: 'object',\n additionalProperties: true\n },\n scraperStatusCode: {\n type: 'number'\n }\n },\n required: [ 'createdAt',\n 'message',\n 'requestId',\n 'status',\n 'success',\n 'updatedAt'\n ]\n }\n }\n}\n```",
22
+ inputSchema: {
23
+ type: 'object',
24
+ properties: {
25
+ id: {
26
+ type: 'string',
27
+ description: 'The variant check request 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: ['id'],
37
+ },
38
+ annotations: {
39
+ readOnlyHint: true,
40
+ },
41
+ };
42
+
43
+ export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
44
+ const { id, jq_filter, ...body } = args as any;
45
+ return asTextContentResult(
46
+ await maybeFilter(jq_filter, await client.products.variantCheck.retrieveStatus(id)),
47
+ );
48
+ };
49
+
50
+ export default { metadata, tool, handler };
@@ -0,0 +1,103 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import HenrySDK from '@henrylabs/sdk';
4
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
5
+
6
+ type TextContentBlock = {
7
+ type: 'text';
8
+ text: string;
9
+ };
10
+
11
+ type ImageContentBlock = {
12
+ type: 'image';
13
+ data: string;
14
+ mimeType: string;
15
+ };
16
+
17
+ type AudioContentBlock = {
18
+ type: 'audio';
19
+ data: string;
20
+ mimeType: string;
21
+ };
22
+
23
+ type ResourceContentBlock = {
24
+ type: 'resource';
25
+ resource:
26
+ | {
27
+ uri: string;
28
+ mimeType: string;
29
+ text: string;
30
+ }
31
+ | {
32
+ uri: string;
33
+ mimeType: string;
34
+ blob: string;
35
+ };
36
+ };
37
+
38
+ export type ContentBlock = TextContentBlock | ImageContentBlock | AudioContentBlock | ResourceContentBlock;
39
+
40
+ export type ToolCallResult = {
41
+ content: ContentBlock[];
42
+ isError?: boolean;
43
+ };
44
+
45
+ export type HandlerFunction = (
46
+ client: HenrySDK,
47
+ args: Record<string, unknown> | undefined,
48
+ ) => Promise<ToolCallResult>;
49
+
50
+ export function asTextContentResult(result: unknown): ToolCallResult {
51
+ return {
52
+ content: [
53
+ {
54
+ type: 'text',
55
+ text: JSON.stringify(result, null, 2),
56
+ },
57
+ ],
58
+ };
59
+ }
60
+
61
+ export async function asBinaryContentResult(response: Response): Promise<ToolCallResult> {
62
+ const blob = await response.blob();
63
+ const mimeType = blob.type;
64
+ const data = Buffer.from(await blob.arrayBuffer()).toString('base64');
65
+ if (mimeType.startsWith('image/')) {
66
+ return {
67
+ content: [{ type: 'image', mimeType, data }],
68
+ };
69
+ } else if (mimeType.startsWith('audio/')) {
70
+ return {
71
+ content: [{ type: 'audio', mimeType, data }],
72
+ };
73
+ } else {
74
+ return {
75
+ content: [
76
+ {
77
+ type: 'resource',
78
+ resource: {
79
+ // We must give a URI, even though this isn't actually an MCP resource.
80
+ uri: 'resource://tool-response',
81
+ mimeType,
82
+ blob: data,
83
+ },
84
+ },
85
+ ],
86
+ };
87
+ }
88
+ }
89
+
90
+ export type Metadata = {
91
+ resource: string;
92
+ operation: 'read' | 'write';
93
+ tags: string[];
94
+ httpMethod?: string;
95
+ httpPath?: string;
96
+ operationId?: string;
97
+ };
98
+
99
+ export type Endpoint = {
100
+ metadata: Metadata;
101
+ tool: Tool;
102
+ handler: HandlerFunction;
103
+ };
@@ -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: 'wallet',
11
+ operation: 'write',
12
+ tags: [],
13
+ httpMethod: 'post',
14
+ httpPath: '/wallet/card-collect',
15
+ operationId: 'initiateCardCollect',
16
+ };
17
+
18
+ export const tool: Tool = {
19
+ name: 'create_card_collection_wallet',
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 modal URL for users to save payment cards. Supports both authenticated and guest card collection\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/wallet_create_card_collection_response',\n $defs: {\n wallet_create_card_collection_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 modal_url: {\n type: 'string'\n }\n },\n required: [ 'modal_url'\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
+ auth: {
29
+ type: 'boolean',
30
+ description: 'Whether authentication is required for card collection (default: true)',
31
+ },
32
+ jq_filter: {
33
+ type: 'string',
34
+ title: 'jq Filter',
35
+ description:
36
+ '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/).',
37
+ },
38
+ },
39
+ required: ['x-user-id'],
40
+ },
41
+ annotations: {},
42
+ };
43
+
44
+ export const handler = async (client: HenrySDK, args: Record<string, unknown> | undefined) => {
45
+ const { jq_filter, ...body } = args as any;
46
+ return asTextContentResult(await maybeFilter(jq_filter, await client.wallet.createCardCollection(body)));
47
+ };
48
+
49
+ export default { metadata, tool, handler };
package/src/tools.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './tools/index';
@@ -0,0 +1,11 @@
1
+ {
2
+ // this config is included in the published src directory to prevent TS errors
3
+ // from appearing when users go to source, and VSCode opens the source .ts file
4
+ // via declaration maps
5
+ "include": ["index.ts"],
6
+ "compilerOptions": {
7
+ "target": "es2015",
8
+ "lib": ["DOM"],
9
+ "moduleResolution": "node"
10
+ }
11
+ }
package/stdio.d.mts ADDED
@@ -0,0 +1,3 @@
1
+ import { McpOptions } from "./options.mjs";
2
+ export declare const launchStdioServer: (options: McpOptions) => Promise<void>;
3
+ //# sourceMappingURL=stdio.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stdio.d.mts","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OAEO,EAAE,UAAU,EAAE;AAErB,eAAO,MAAM,iBAAiB,GAAU,SAAS,UAAU,kBAQ1D,CAAC"}
package/stdio.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { McpOptions } from "./options.js";
2
+ export declare const launchStdioServer: (options: McpOptions) => Promise<void>;
3
+ //# sourceMappingURL=stdio.d.ts.map
package/stdio.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OAEO,EAAE,UAAU,EAAE;AAErB,eAAO,MAAM,iBAAiB,GAAU,SAAS,UAAU,kBAQ1D,CAAC"}
package/stdio.js ADDED
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.launchStdioServer = void 0;
4
+ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
5
+ const server_1 = require("./server.js");
6
+ const launchStdioServer = async (options) => {
7
+ const server = (0, server_1.newMcpServer)();
8
+ (0, server_1.initMcpServer)({ server, mcpOptions: options });
9
+ const transport = new stdio_js_1.StdioServerTransport();
10
+ await server.connect(transport);
11
+ console.error('MCP Server running on stdio');
12
+ };
13
+ exports.launchStdioServer = launchStdioServer;
14
+ //# sourceMappingURL=stdio.js.map
package/stdio.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stdio.js","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":";;;AAAA,wEAAiF;AACjF,wCAAuD;AAGhD,MAAM,iBAAiB,GAAG,KAAK,EAAE,OAAmB,EAAE,EAAE;IAC7D,MAAM,MAAM,GAAG,IAAA,qBAAY,GAAE,CAAC;IAE9B,IAAA,sBAAa,EAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;IAE/C,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;AAC/C,CAAC,CAAC;AARW,QAAA,iBAAiB,qBAQ5B"}
package/stdio.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
2
+ import { initMcpServer, newMcpServer } from "./server.mjs";
3
+ export const launchStdioServer = async (options) => {
4
+ const server = newMcpServer();
5
+ initMcpServer({ server, mcpOptions: options });
6
+ const transport = new StdioServerTransport();
7
+ await server.connect(transport);
8
+ console.error('MCP Server running on stdio');
9
+ };
10
+ //# sourceMappingURL=stdio.mjs.map
package/stdio.mjs.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stdio.mjs","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C;OACzE,EAAE,aAAa,EAAE,YAAY,EAAE;AAGtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,OAAmB,EAAE,EAAE;IAC7D,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAE9B,aAAa,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;IAE/C,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;AAC/C,CAAC,CAAC"}
@@ -0,0 +1,45 @@
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-cart.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-checkout-cart.d.mts","sourceRoot":"","sources":["../../src/tools/cart/create-checkout-cart.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"}
@@ -0,0 +1,45 @@
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-cart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-checkout-cart.d.ts","sourceRoot":"","sources":["../../src/tools/cart/create-checkout-cart.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"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.handler = exports.tool = exports.metadata = void 0;
5
+ const filtering_1 = require("@henrylabs/mcp/filtering");
6
+ const types_1 = require("@henrylabs/mcp/tools/types");
7
+ exports.metadata = {
8
+ resource: 'cart',
9
+ operation: 'write',
10
+ tags: [],
11
+ httpMethod: 'post',
12
+ httpPath: '/cart/checkout',
13
+ operationId: 'createHostedCheckoutPage',
14
+ };
15
+ exports.tool = {
16
+ name: 'create_checkout_cart',
17
+ description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nGenerates a hosted checkout URL for the user's cart that can be embedded in an iframe or modal. The page walks the buyer through reviewing the order, entering shipping and payment information, and confirming the purchase.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/cart_create_checkout_response',\n $defs: {\n cart_create_checkout_response: {\n type: 'object',\n properties: {\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n },\n data: {\n type: 'object',\n properties: {\n checkout_url: {\n type: 'string'\n }\n },\n required: [ 'checkout_url'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
18
+ inputSchema: {
19
+ type: 'object',
20
+ properties: {
21
+ 'x-user-id': {
22
+ type: 'string',
23
+ },
24
+ auth: {
25
+ type: 'boolean',
26
+ description: 'Whether authentication is required for checkout (default: true)',
27
+ },
28
+ jq_filter: {
29
+ type: 'string',
30
+ title: 'jq Filter',
31
+ description: 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
32
+ },
33
+ },
34
+ required: ['x-user-id'],
35
+ },
36
+ annotations: {},
37
+ };
38
+ const handler = async (client, args) => {
39
+ const { jq_filter, ...body } = args;
40
+ return (0, types_1.asTextContentResult)(await (0, filtering_1.maybeFilter)(jq_filter, await client.cart.createCheckout(body)));
41
+ };
42
+ exports.handler = handler;
43
+ exports.default = { metadata: exports.metadata, tool: exports.tool, handler: exports.handler };
44
+ //# sourceMappingURL=create-checkout-cart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-checkout-cart.js","sourceRoot":"","sources":["../../src/tools/cart/create-checkout-cart.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAuD;AACvD,sDAA2E;AAK9D,QAAA,QAAQ,GAAa;IAChC,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,OAAO;IAClB,IAAI,EAAE,EAAE;IACR,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,gBAAgB;IAC1B,WAAW,EAAE,0BAA0B;CACxC,CAAC;AAEW,QAAA,IAAI,GAAS;IACxB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACT,8jCAA8jC;IAChkC,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"}
@@ -0,0 +1,40 @@
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';
4
+ export const metadata = {
5
+ resource: 'cart',
6
+ operation: 'write',
7
+ tags: [],
8
+ httpMethod: 'post',
9
+ httpPath: '/cart/checkout',
10
+ operationId: 'createHostedCheckoutPage',
11
+ };
12
+ export const tool = {
13
+ name: 'create_checkout_cart',
14
+ description: "When using this tool, always use the `jq_filter` parameter to reduce the response size and improve performance.\n\nOnly omit if you're sure you don't need the data.\n\nGenerates a hosted checkout URL for the user's cart that can be embedded in an iframe or modal. The page walks the buyer through reviewing the order, entering shipping and payment information, and confirming the purchase.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/cart_create_checkout_response',\n $defs: {\n cart_create_checkout_response: {\n type: 'object',\n properties: {\n message: {\n type: 'string'\n },\n status: {\n type: 'string'\n },\n success: {\n type: 'boolean'\n },\n data: {\n type: 'object',\n properties: {\n checkout_url: {\n type: 'string'\n }\n },\n required: [ 'checkout_url'\n ]\n }\n },\n required: [ 'message',\n 'status',\n 'success'\n ]\n }\n }\n}\n```",
15
+ inputSchema: {
16
+ type: 'object',
17
+ properties: {
18
+ 'x-user-id': {
19
+ type: 'string',
20
+ },
21
+ auth: {
22
+ type: 'boolean',
23
+ description: 'Whether authentication is required for checkout (default: true)',
24
+ },
25
+ jq_filter: {
26
+ type: 'string',
27
+ title: 'jq Filter',
28
+ description: 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
29
+ },
30
+ },
31
+ required: ['x-user-id'],
32
+ },
33
+ annotations: {},
34
+ };
35
+ export const handler = async (client, args) => {
36
+ const { jq_filter, ...body } = args;
37
+ return asTextContentResult(await maybeFilter(jq_filter, await client.cart.createCheckout(body)));
38
+ };
39
+ export default { metadata, tool, handler };
40
+ //# sourceMappingURL=create-checkout-cart.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-checkout-cart.mjs","sourceRoot":"","sources":["../../src/tools/cart/create-checkout-cart.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,EAAE;IACR,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,gBAAgB;IAC1B,WAAW,EAAE,0BAA0B;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAAS;IACxB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACT,8jCAA8jC;IAChkC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;aACf;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,iEAAiE;aAC/E;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,kWAAkW;aACrW;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;IACD,WAAW,EAAE,EAAE;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,EAAE,MAAgB,EAAE,IAAyC,EAAE,EAAE;IAC3F,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAW,CAAC;IAC3C,OAAO,mBAAmB,CAAC,MAAM,WAAW,CAAC,SAAS,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACnG,CAAC,CAAC;AAEF,eAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC"}