dodopayments-mcp 1.44.0 → 1.49.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 (152) hide show
  1. package/README.md +18 -0
  2. package/package.json +2 -2
  3. package/server.js +1 -1
  4. package/server.mjs +1 -1
  5. package/src/server.ts +1 -1
  6. package/src/tools/discounts/create-discounts.ts +6 -1
  7. package/src/tools/discounts/list-discounts.ts +1 -1
  8. package/src/tools/discounts/retrieve-discounts.ts +1 -1
  9. package/src/tools/discounts/update-discounts.ts +6 -1
  10. package/src/tools/index.ts +18 -0
  11. package/src/tools/payments/create-payments.ts +2 -8
  12. package/src/tools/products/create-products.ts +4 -0
  13. package/src/tools/products/update-products.ts +4 -0
  14. package/src/tools/subscriptions/create-subscriptions.ts +2 -8
  15. package/src/tools/subscriptions/update-subscriptions.ts +4 -0
  16. package/src/tools/webhooks/create-webhooks.ts +105 -0
  17. package/src/tools/webhooks/delete-webhooks.ts +40 -0
  18. package/src/tools/webhooks/headers/retrieve-webhooks-headers.ts +49 -0
  19. package/src/tools/webhooks/headers/update-webhooks-headers.ts +42 -0
  20. package/src/tools/webhooks/list-webhooks.ts +53 -0
  21. package/src/tools/webhooks/retrieve-secret-webhooks.ts +47 -0
  22. package/src/tools/webhooks/retrieve-webhooks.ts +47 -0
  23. package/src/tools/webhooks/update-webhooks.ts +102 -0
  24. package/src/tools/your-webhook-url/create-your-webhook-url.ts +1150 -0
  25. package/tools/discounts/create-discounts.d.mts.map +1 -1
  26. package/tools/discounts/create-discounts.d.ts.map +1 -1
  27. package/tools/discounts/create-discounts.js +5 -1
  28. package/tools/discounts/create-discounts.js.map +1 -1
  29. package/tools/discounts/create-discounts.mjs +5 -1
  30. package/tools/discounts/create-discounts.mjs.map +1 -1
  31. package/tools/discounts/list-discounts.js +1 -1
  32. package/tools/discounts/list-discounts.js.map +1 -1
  33. package/tools/discounts/list-discounts.mjs +1 -1
  34. package/tools/discounts/list-discounts.mjs.map +1 -1
  35. package/tools/discounts/retrieve-discounts.js +1 -1
  36. package/tools/discounts/retrieve-discounts.js.map +1 -1
  37. package/tools/discounts/retrieve-discounts.mjs +1 -1
  38. package/tools/discounts/retrieve-discounts.mjs.map +1 -1
  39. package/tools/discounts/update-discounts.d.mts.map +1 -1
  40. package/tools/discounts/update-discounts.d.ts.map +1 -1
  41. package/tools/discounts/update-discounts.js +5 -1
  42. package/tools/discounts/update-discounts.js.map +1 -1
  43. package/tools/discounts/update-discounts.mjs +5 -1
  44. package/tools/discounts/update-discounts.mjs.map +1 -1
  45. package/tools/index.d.mts.map +1 -1
  46. package/tools/index.d.ts.map +1 -1
  47. package/tools/index.js +18 -0
  48. package/tools/index.js.map +1 -1
  49. package/tools/index.mjs +18 -0
  50. package/tools/index.mjs.map +1 -1
  51. package/tools/payments/create-payments.d.mts.map +1 -1
  52. package/tools/payments/create-payments.d.ts.map +1 -1
  53. package/tools/payments/create-payments.js +2 -7
  54. package/tools/payments/create-payments.js.map +1 -1
  55. package/tools/payments/create-payments.mjs +2 -7
  56. package/tools/payments/create-payments.mjs.map +1 -1
  57. package/tools/products/create-products.d.mts.map +1 -1
  58. package/tools/products/create-products.d.ts.map +1 -1
  59. package/tools/products/create-products.js +4 -0
  60. package/tools/products/create-products.js.map +1 -1
  61. package/tools/products/create-products.mjs +4 -0
  62. package/tools/products/create-products.mjs.map +1 -1
  63. package/tools/products/update-products.d.mts.map +1 -1
  64. package/tools/products/update-products.d.ts.map +1 -1
  65. package/tools/products/update-products.js +4 -0
  66. package/tools/products/update-products.js.map +1 -1
  67. package/tools/products/update-products.mjs +4 -0
  68. package/tools/products/update-products.mjs.map +1 -1
  69. package/tools/subscriptions/create-subscriptions.d.mts.map +1 -1
  70. package/tools/subscriptions/create-subscriptions.d.ts.map +1 -1
  71. package/tools/subscriptions/create-subscriptions.js +2 -7
  72. package/tools/subscriptions/create-subscriptions.js.map +1 -1
  73. package/tools/subscriptions/create-subscriptions.mjs +2 -7
  74. package/tools/subscriptions/create-subscriptions.mjs.map +1 -1
  75. package/tools/subscriptions/update-subscriptions.d.mts.map +1 -1
  76. package/tools/subscriptions/update-subscriptions.d.ts.map +1 -1
  77. package/tools/subscriptions/update-subscriptions.js +4 -0
  78. package/tools/subscriptions/update-subscriptions.js.map +1 -1
  79. package/tools/subscriptions/update-subscriptions.mjs +4 -0
  80. package/tools/subscriptions/update-subscriptions.mjs.map +1 -1
  81. package/tools/webhooks/create-webhooks.d.mts +45 -0
  82. package/tools/webhooks/create-webhooks.d.mts.map +1 -0
  83. package/tools/webhooks/create-webhooks.d.ts +45 -0
  84. package/tools/webhooks/create-webhooks.d.ts.map +1 -0
  85. package/tools/webhooks/create-webhooks.js +99 -0
  86. package/tools/webhooks/create-webhooks.js.map +1 -0
  87. package/tools/webhooks/create-webhooks.mjs +95 -0
  88. package/tools/webhooks/create-webhooks.mjs.map +1 -0
  89. package/tools/webhooks/delete-webhooks.d.mts +45 -0
  90. package/tools/webhooks/delete-webhooks.d.mts.map +1 -0
  91. package/tools/webhooks/delete-webhooks.d.ts +45 -0
  92. package/tools/webhooks/delete-webhooks.d.ts.map +1 -0
  93. package/tools/webhooks/delete-webhooks.js +37 -0
  94. package/tools/webhooks/delete-webhooks.js.map +1 -0
  95. package/tools/webhooks/delete-webhooks.mjs +33 -0
  96. package/tools/webhooks/delete-webhooks.mjs.map +1 -0
  97. package/tools/webhooks/headers/retrieve-webhooks-headers.d.mts +45 -0
  98. package/tools/webhooks/headers/retrieve-webhooks-headers.d.mts.map +1 -0
  99. package/tools/webhooks/headers/retrieve-webhooks-headers.d.ts +45 -0
  100. package/tools/webhooks/headers/retrieve-webhooks-headers.d.ts.map +1 -0
  101. package/tools/webhooks/headers/retrieve-webhooks-headers.js +42 -0
  102. package/tools/webhooks/headers/retrieve-webhooks-headers.js.map +1 -0
  103. package/tools/webhooks/headers/retrieve-webhooks-headers.mjs +38 -0
  104. package/tools/webhooks/headers/retrieve-webhooks-headers.mjs.map +1 -0
  105. package/tools/webhooks/headers/update-webhooks-headers.d.mts +45 -0
  106. package/tools/webhooks/headers/update-webhooks-headers.d.mts.map +1 -0
  107. package/tools/webhooks/headers/update-webhooks-headers.d.ts +45 -0
  108. package/tools/webhooks/headers/update-webhooks-headers.d.ts.map +1 -0
  109. package/tools/webhooks/headers/update-webhooks-headers.js +39 -0
  110. package/tools/webhooks/headers/update-webhooks-headers.js.map +1 -0
  111. package/tools/webhooks/headers/update-webhooks-headers.mjs +35 -0
  112. package/tools/webhooks/headers/update-webhooks-headers.mjs.map +1 -0
  113. package/tools/webhooks/list-webhooks.d.mts +45 -0
  114. package/tools/webhooks/list-webhooks.d.mts.map +1 -0
  115. package/tools/webhooks/list-webhooks.d.ts +45 -0
  116. package/tools/webhooks/list-webhooks.d.ts.map +1 -0
  117. package/tools/webhooks/list-webhooks.js +48 -0
  118. package/tools/webhooks/list-webhooks.js.map +1 -0
  119. package/tools/webhooks/list-webhooks.mjs +44 -0
  120. package/tools/webhooks/list-webhooks.mjs.map +1 -0
  121. package/tools/webhooks/retrieve-secret-webhooks.d.mts +45 -0
  122. package/tools/webhooks/retrieve-secret-webhooks.d.mts.map +1 -0
  123. package/tools/webhooks/retrieve-secret-webhooks.d.ts +45 -0
  124. package/tools/webhooks/retrieve-secret-webhooks.d.ts.map +1 -0
  125. package/tools/webhooks/retrieve-secret-webhooks.js +42 -0
  126. package/tools/webhooks/retrieve-secret-webhooks.js.map +1 -0
  127. package/tools/webhooks/retrieve-secret-webhooks.mjs +38 -0
  128. package/tools/webhooks/retrieve-secret-webhooks.mjs.map +1 -0
  129. package/tools/webhooks/retrieve-webhooks.d.mts +45 -0
  130. package/tools/webhooks/retrieve-webhooks.d.mts.map +1 -0
  131. package/tools/webhooks/retrieve-webhooks.d.ts +45 -0
  132. package/tools/webhooks/retrieve-webhooks.d.ts.map +1 -0
  133. package/tools/webhooks/retrieve-webhooks.js +42 -0
  134. package/tools/webhooks/retrieve-webhooks.js.map +1 -0
  135. package/tools/webhooks/retrieve-webhooks.mjs +38 -0
  136. package/tools/webhooks/retrieve-webhooks.mjs.map +1 -0
  137. package/tools/webhooks/update-webhooks.d.mts +45 -0
  138. package/tools/webhooks/update-webhooks.d.mts.map +1 -0
  139. package/tools/webhooks/update-webhooks.d.ts +45 -0
  140. package/tools/webhooks/update-webhooks.d.ts.map +1 -0
  141. package/tools/webhooks/update-webhooks.js +96 -0
  142. package/tools/webhooks/update-webhooks.js.map +1 -0
  143. package/tools/webhooks/update-webhooks.mjs +92 -0
  144. package/tools/webhooks/update-webhooks.mjs.map +1 -0
  145. package/tools/your-webhook-url/create-your-webhook-url.d.mts +45 -0
  146. package/tools/your-webhook-url/create-your-webhook-url.d.mts.map +1 -0
  147. package/tools/your-webhook-url/create-your-webhook-url.d.ts +45 -0
  148. package/tools/your-webhook-url/create-your-webhook-url.d.ts.map +1 -0
  149. package/tools/your-webhook-url/create-your-webhook-url.js +1139 -0
  150. package/tools/your-webhook-url/create-your-webhook-url.js.map +1 -0
  151. package/tools/your-webhook-url/create-your-webhook-url.mjs +1135 -0
  152. package/tools/your-webhook-url/create-your-webhook-url.mjs.map +1 -0
package/README.md CHANGED
@@ -273,3 +273,21 @@ The following tools are available in this MCP server.
273
273
  - `update_brands` (`write`):
274
274
  - `list_brands` (`read`):
275
275
  - `update_images_brands` (`write`):
276
+
277
+ ### Resource `webhooks`:
278
+
279
+ - `create_webhooks` (`write`): Create a new webhook
280
+ - `retrieve_webhooks` (`read`): Get a webhook by id
281
+ - `update_webhooks` (`write`): Patch a webhook by id
282
+ - `list_webhooks` (`read`): List all webhooks
283
+ - `delete_webhooks` (`write`): Delete a webhook by id
284
+ - `retrieve_secret_webhooks` (`read`): Get webhook secret by id
285
+
286
+ ### Resource `webhooks.headers`:
287
+
288
+ - `retrieve_webhooks_headers` (`read`): Get a webhook by id
289
+ - `update_webhooks_headers` (`write`): Patch a webhook by id
290
+
291
+ ### Resource `your_webhook_url`:
292
+
293
+ - `create_your_webhook_url` (`write`):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dodopayments-mcp",
3
- "version": "1.44.0",
3
+ "version": "1.49.0",
4
4
  "description": "The official MCP Server for the Dodo Payments API",
5
5
  "author": "Dodo Payments <founders@dodopayments.com>",
6
6
  "types": "./index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "fix": "eslint --fix --ext ts,js ."
25
25
  },
26
26
  "dependencies": {
27
- "dodopayments": "^1.44.0",
27
+ "dodopayments": "^1.49.0",
28
28
  "@modelcontextprotocol/sdk": "^1.11.5",
29
29
  "jq-web": "https://github.com/stainless-api/jq-web/releases/download/v0.8.2/jq-web.tar.gz",
30
30
  "yargs": "^17.7.2",
package/server.js CHANGED
@@ -20,7 +20,7 @@ Object.defineProperty(exports, "endpoints", { enumerable: true, get: function ()
20
20
  // Create server instance
21
21
  exports.server = new mcp_js_1.McpServer({
22
22
  name: 'dodopayments_api',
23
- version: '1.44.0',
23
+ version: '1.49.0',
24
24
  }, { capabilities: { tools: {}, logging: {} } });
25
25
  /**
26
26
  * Initializes the provided MCP Server with the given tools and handlers.
package/server.mjs CHANGED
@@ -9,7 +9,7 @@ export { endpoints } from "./tools.mjs";
9
9
  // Create server instance
10
10
  export const server = new McpServer({
11
11
  name: 'dodopayments_api',
12
- version: '1.44.0',
12
+ version: '1.49.0',
13
13
  }, { capabilities: { tools: {}, logging: {} } });
14
14
  /**
15
15
  * Initializes the provided MCP Server with the given tools and handlers.
package/src/server.ts CHANGED
@@ -26,7 +26,7 @@ export { endpoints } from './tools';
26
26
  export const server = new McpServer(
27
27
  {
28
28
  name: 'dodopayments_api',
29
- version: '1.44.0',
29
+ version: '1.49.0',
30
30
  },
31
31
  { capabilities: { tools: {}, logging: {} } },
32
32
  );
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
18
18
  export const tool: Tool = {
19
19
  name: 'create_discounts',
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\nPOST /discounts\nIf `code` is omitted or empty, a random 16-char uppercase code is generated.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/discount',\n $defs: {\n discount: {\n type: 'object',\n properties: {\n amount: {\n type: 'integer',\n description: 'The discount amount.\\n\\n- If `discount_type` is `percentage`, this is in **basis points**\\n (e.g., 540 => 5.4%).\\n- Otherwise, this is **USD cents** (e.g., 100 => `$1.00`).'\n },\n business_id: {\n type: 'string',\n description: 'The business this discount belongs to.'\n },\n code: {\n type: 'string',\n description: 'The discount code (up to 16 chars).'\n },\n created_at: {\n type: 'string',\n description: 'Timestamp when the discount is created',\n format: 'date-time'\n },\n discount_id: {\n type: 'string',\n description: 'The unique discount ID'\n },\n restricted_to: {\n type: 'array',\n description: 'List of product IDs to which this discount is restricted.',\n items: {\n type: 'string'\n }\n },\n times_used: {\n type: 'integer',\n description: 'How many times this discount has been used.'\n },\n type: {\n $ref: '#/$defs/discount_type'\n },\n expires_at: {\n type: 'string',\n description: 'Optional date/time after which discount is expired.',\n format: 'date-time'\n },\n name: {\n type: 'string',\n description: 'Name for the Discount'\n },\n usage_limit: {\n type: 'integer',\n description: 'Usage limit for this discount, if any.'\n }\n },\n required: [ 'amount',\n 'business_id',\n 'code',\n 'created_at',\n 'discount_id',\n 'restricted_to',\n 'times_used',\n 'type'\n ]\n },\n discount_type: {\n type: 'string',\n enum: [ 'percentage'\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\nPOST /discounts\nIf `code` is omitted or empty, a random 16-char uppercase code is generated.\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/discount',\n $defs: {\n discount: {\n type: 'object',\n properties: {\n amount: {\n type: 'integer',\n description: 'The discount amount.\\n\\n- If `discount_type` is `percentage`, this is in **basis points**\\n (e.g., 540 => 5.4%).\\n- Otherwise, this is **USD cents** (e.g., 100 => `$1.00`).'\n },\n business_id: {\n type: 'string',\n description: 'The business this discount belongs to.'\n },\n code: {\n type: 'string',\n description: 'The discount code (up to 16 chars).'\n },\n created_at: {\n type: 'string',\n description: 'Timestamp when the discount is created',\n format: 'date-time'\n },\n discount_id: {\n type: 'string',\n description: 'The unique discount ID'\n },\n restricted_to: {\n type: 'array',\n description: 'List of product IDs to which this discount is restricted.',\n items: {\n type: 'string'\n }\n },\n times_used: {\n type: 'integer',\n description: 'How many times this discount has been used.'\n },\n type: {\n $ref: '#/$defs/discount_type'\n },\n expires_at: {\n type: 'string',\n description: 'Optional date/time after which discount is expired.',\n format: 'date-time'\n },\n name: {\n type: 'string',\n description: 'Name for the Discount'\n },\n subscription_cycles: {\n type: 'integer',\n description: 'Number of subscription billing cycles this discount is valid for.\\nIf not provided, the discount will be applied indefinitely to\\nall recurring payments related to the subscription.'\n },\n usage_limit: {\n type: 'integer',\n description: 'Usage limit for this discount, if any.'\n }\n },\n required: [ 'amount',\n 'business_id',\n 'code',\n 'created_at',\n 'discount_id',\n 'restricted_to',\n 'times_used',\n 'type'\n ]\n },\n discount_type: {\n type: 'string',\n enum: [ 'percentage'\n ]\n }\n }\n}\n```",
22
22
  inputSchema: {
23
23
  type: 'object',
24
24
  properties: {
@@ -50,6 +50,11 @@ export const tool: Tool = {
50
50
  type: 'string',
51
51
  },
52
52
  },
53
+ subscription_cycles: {
54
+ type: 'integer',
55
+ description:
56
+ 'Number of subscription billing cycles this discount is valid for.\nIf not provided, the discount will be applied indefinitely to\nall recurring payments related to the subscription.',
57
+ },
53
58
  usage_limit: {
54
59
  type: 'integer',
55
60
  description: 'How many times this discount can be used (if any).\nMust be >= 1 if provided.',
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
18
18
  export const tool: Tool = {
19
19
  name: 'list_discounts',
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\nGET /discounts\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n items: {\n type: 'array',\n description: 'Array of active (non-deleted) discounts for the current page.',\n items: {\n $ref: '#/$defs/discount'\n }\n }\n },\n required: [ 'items'\n ],\n $defs: {\n discount: {\n type: 'object',\n properties: {\n amount: {\n type: 'integer',\n description: 'The discount amount.\\n\\n- If `discount_type` is `percentage`, this is in **basis points**\\n (e.g., 540 => 5.4%).\\n- Otherwise, this is **USD cents** (e.g., 100 => `$1.00`).'\n },\n business_id: {\n type: 'string',\n description: 'The business this discount belongs to.'\n },\n code: {\n type: 'string',\n description: 'The discount code (up to 16 chars).'\n },\n created_at: {\n type: 'string',\n description: 'Timestamp when the discount is created',\n format: 'date-time'\n },\n discount_id: {\n type: 'string',\n description: 'The unique discount ID'\n },\n restricted_to: {\n type: 'array',\n description: 'List of product IDs to which this discount is restricted.',\n items: {\n type: 'string'\n }\n },\n times_used: {\n type: 'integer',\n description: 'How many times this discount has been used.'\n },\n type: {\n $ref: '#/$defs/discount_type'\n },\n expires_at: {\n type: 'string',\n description: 'Optional date/time after which discount is expired.',\n format: 'date-time'\n },\n name: {\n type: 'string',\n description: 'Name for the Discount'\n },\n usage_limit: {\n type: 'integer',\n description: 'Usage limit for this discount, if any.'\n }\n },\n required: [ 'amount',\n 'business_id',\n 'code',\n 'created_at',\n 'discount_id',\n 'restricted_to',\n 'times_used',\n 'type'\n ]\n },\n discount_type: {\n type: 'string',\n enum: [ 'percentage'\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\nGET /discounts\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n items: {\n type: 'array',\n description: 'Array of active (non-deleted) discounts for the current page.',\n items: {\n $ref: '#/$defs/discount'\n }\n }\n },\n required: [ 'items'\n ],\n $defs: {\n discount: {\n type: 'object',\n properties: {\n amount: {\n type: 'integer',\n description: 'The discount amount.\\n\\n- If `discount_type` is `percentage`, this is in **basis points**\\n (e.g., 540 => 5.4%).\\n- Otherwise, this is **USD cents** (e.g., 100 => `$1.00`).'\n },\n business_id: {\n type: 'string',\n description: 'The business this discount belongs to.'\n },\n code: {\n type: 'string',\n description: 'The discount code (up to 16 chars).'\n },\n created_at: {\n type: 'string',\n description: 'Timestamp when the discount is created',\n format: 'date-time'\n },\n discount_id: {\n type: 'string',\n description: 'The unique discount ID'\n },\n restricted_to: {\n type: 'array',\n description: 'List of product IDs to which this discount is restricted.',\n items: {\n type: 'string'\n }\n },\n times_used: {\n type: 'integer',\n description: 'How many times this discount has been used.'\n },\n type: {\n $ref: '#/$defs/discount_type'\n },\n expires_at: {\n type: 'string',\n description: 'Optional date/time after which discount is expired.',\n format: 'date-time'\n },\n name: {\n type: 'string',\n description: 'Name for the Discount'\n },\n subscription_cycles: {\n type: 'integer',\n description: 'Number of subscription billing cycles this discount is valid for.\\nIf not provided, the discount will be applied indefinitely to\\nall recurring payments related to the subscription.'\n },\n usage_limit: {\n type: 'integer',\n description: 'Usage limit for this discount, if any.'\n }\n },\n required: [ 'amount',\n 'business_id',\n 'code',\n 'created_at',\n 'discount_id',\n 'restricted_to',\n 'times_used',\n 'type'\n ]\n },\n discount_type: {\n type: 'string',\n enum: [ 'percentage'\n ]\n }\n }\n}\n```",
22
22
  inputSchema: {
23
23
  type: 'object',
24
24
  properties: {
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
18
18
  export const tool: Tool = {
19
19
  name: 'retrieve_discounts',
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\nGET /discounts/{discount_id}\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/discount',\n $defs: {\n discount: {\n type: 'object',\n properties: {\n amount: {\n type: 'integer',\n description: 'The discount amount.\\n\\n- If `discount_type` is `percentage`, this is in **basis points**\\n (e.g., 540 => 5.4%).\\n- Otherwise, this is **USD cents** (e.g., 100 => `$1.00`).'\n },\n business_id: {\n type: 'string',\n description: 'The business this discount belongs to.'\n },\n code: {\n type: 'string',\n description: 'The discount code (up to 16 chars).'\n },\n created_at: {\n type: 'string',\n description: 'Timestamp when the discount is created',\n format: 'date-time'\n },\n discount_id: {\n type: 'string',\n description: 'The unique discount ID'\n },\n restricted_to: {\n type: 'array',\n description: 'List of product IDs to which this discount is restricted.',\n items: {\n type: 'string'\n }\n },\n times_used: {\n type: 'integer',\n description: 'How many times this discount has been used.'\n },\n type: {\n $ref: '#/$defs/discount_type'\n },\n expires_at: {\n type: 'string',\n description: 'Optional date/time after which discount is expired.',\n format: 'date-time'\n },\n name: {\n type: 'string',\n description: 'Name for the Discount'\n },\n usage_limit: {\n type: 'integer',\n description: 'Usage limit for this discount, if any.'\n }\n },\n required: [ 'amount',\n 'business_id',\n 'code',\n 'created_at',\n 'discount_id',\n 'restricted_to',\n 'times_used',\n 'type'\n ]\n },\n discount_type: {\n type: 'string',\n enum: [ 'percentage'\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\nGET /discounts/{discount_id}\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/discount',\n $defs: {\n discount: {\n type: 'object',\n properties: {\n amount: {\n type: 'integer',\n description: 'The discount amount.\\n\\n- If `discount_type` is `percentage`, this is in **basis points**\\n (e.g., 540 => 5.4%).\\n- Otherwise, this is **USD cents** (e.g., 100 => `$1.00`).'\n },\n business_id: {\n type: 'string',\n description: 'The business this discount belongs to.'\n },\n code: {\n type: 'string',\n description: 'The discount code (up to 16 chars).'\n },\n created_at: {\n type: 'string',\n description: 'Timestamp when the discount is created',\n format: 'date-time'\n },\n discount_id: {\n type: 'string',\n description: 'The unique discount ID'\n },\n restricted_to: {\n type: 'array',\n description: 'List of product IDs to which this discount is restricted.',\n items: {\n type: 'string'\n }\n },\n times_used: {\n type: 'integer',\n description: 'How many times this discount has been used.'\n },\n type: {\n $ref: '#/$defs/discount_type'\n },\n expires_at: {\n type: 'string',\n description: 'Optional date/time after which discount is expired.',\n format: 'date-time'\n },\n name: {\n type: 'string',\n description: 'Name for the Discount'\n },\n subscription_cycles: {\n type: 'integer',\n description: 'Number of subscription billing cycles this discount is valid for.\\nIf not provided, the discount will be applied indefinitely to\\nall recurring payments related to the subscription.'\n },\n usage_limit: {\n type: 'integer',\n description: 'Usage limit for this discount, if any.'\n }\n },\n required: [ 'amount',\n 'business_id',\n 'code',\n 'created_at',\n 'discount_id',\n 'restricted_to',\n 'times_used',\n 'type'\n ]\n },\n discount_type: {\n type: 'string',\n enum: [ 'percentage'\n ]\n }\n }\n}\n```",
22
22
  inputSchema: {
23
23
  type: 'object',
24
24
  properties: {
@@ -18,7 +18,7 @@ export const metadata: Metadata = {
18
18
  export const tool: Tool = {
19
19
  name: 'update_discounts',
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\nPATCH /discounts/{discount_id}\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/discount',\n $defs: {\n discount: {\n type: 'object',\n properties: {\n amount: {\n type: 'integer',\n description: 'The discount amount.\\n\\n- If `discount_type` is `percentage`, this is in **basis points**\\n (e.g., 540 => 5.4%).\\n- Otherwise, this is **USD cents** (e.g., 100 => `$1.00`).'\n },\n business_id: {\n type: 'string',\n description: 'The business this discount belongs to.'\n },\n code: {\n type: 'string',\n description: 'The discount code (up to 16 chars).'\n },\n created_at: {\n type: 'string',\n description: 'Timestamp when the discount is created',\n format: 'date-time'\n },\n discount_id: {\n type: 'string',\n description: 'The unique discount ID'\n },\n restricted_to: {\n type: 'array',\n description: 'List of product IDs to which this discount is restricted.',\n items: {\n type: 'string'\n }\n },\n times_used: {\n type: 'integer',\n description: 'How many times this discount has been used.'\n },\n type: {\n $ref: '#/$defs/discount_type'\n },\n expires_at: {\n type: 'string',\n description: 'Optional date/time after which discount is expired.',\n format: 'date-time'\n },\n name: {\n type: 'string',\n description: 'Name for the Discount'\n },\n usage_limit: {\n type: 'integer',\n description: 'Usage limit for this discount, if any.'\n }\n },\n required: [ 'amount',\n 'business_id',\n 'code',\n 'created_at',\n 'discount_id',\n 'restricted_to',\n 'times_used',\n 'type'\n ]\n },\n discount_type: {\n type: 'string',\n enum: [ 'percentage'\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\nPATCH /discounts/{discount_id}\n\n# Response Schema\n```json\n{\n $ref: '#/$defs/discount',\n $defs: {\n discount: {\n type: 'object',\n properties: {\n amount: {\n type: 'integer',\n description: 'The discount amount.\\n\\n- If `discount_type` is `percentage`, this is in **basis points**\\n (e.g., 540 => 5.4%).\\n- Otherwise, this is **USD cents** (e.g., 100 => `$1.00`).'\n },\n business_id: {\n type: 'string',\n description: 'The business this discount belongs to.'\n },\n code: {\n type: 'string',\n description: 'The discount code (up to 16 chars).'\n },\n created_at: {\n type: 'string',\n description: 'Timestamp when the discount is created',\n format: 'date-time'\n },\n discount_id: {\n type: 'string',\n description: 'The unique discount ID'\n },\n restricted_to: {\n type: 'array',\n description: 'List of product IDs to which this discount is restricted.',\n items: {\n type: 'string'\n }\n },\n times_used: {\n type: 'integer',\n description: 'How many times this discount has been used.'\n },\n type: {\n $ref: '#/$defs/discount_type'\n },\n expires_at: {\n type: 'string',\n description: 'Optional date/time after which discount is expired.',\n format: 'date-time'\n },\n name: {\n type: 'string',\n description: 'Name for the Discount'\n },\n subscription_cycles: {\n type: 'integer',\n description: 'Number of subscription billing cycles this discount is valid for.\\nIf not provided, the discount will be applied indefinitely to\\nall recurring payments related to the subscription.'\n },\n usage_limit: {\n type: 'integer',\n description: 'Usage limit for this discount, if any.'\n }\n },\n required: [ 'amount',\n 'business_id',\n 'code',\n 'created_at',\n 'discount_id',\n 'restricted_to',\n 'times_used',\n 'type'\n ]\n },\n discount_type: {\n type: 'string',\n enum: [ 'percentage'\n ]\n }\n }\n}\n```",
22
22
  inputSchema: {
23
23
  type: 'object',
24
24
  properties: {
@@ -49,6 +49,11 @@ export const tool: Tool = {
49
49
  type: 'string',
50
50
  },
51
51
  },
52
+ subscription_cycles: {
53
+ type: 'integer',
54
+ description:
55
+ 'Number of subscription billing cycles this discount is valid for.\nIf not provided, the discount will be applied indefinitely to\nall recurring payments related to the subscription.',
56
+ },
52
57
  type: {
53
58
  $ref: '#/$defs/discount_type',
54
59
  },
@@ -59,6 +59,15 @@ import retrieve_brands from './brands/retrieve-brands';
59
59
  import update_brands from './brands/update-brands';
60
60
  import list_brands from './brands/list-brands';
61
61
  import update_images_brands from './brands/update-images-brands';
62
+ import create_webhooks from './webhooks/create-webhooks';
63
+ import retrieve_webhooks from './webhooks/retrieve-webhooks';
64
+ import update_webhooks from './webhooks/update-webhooks';
65
+ import list_webhooks from './webhooks/list-webhooks';
66
+ import delete_webhooks from './webhooks/delete-webhooks';
67
+ import retrieve_secret_webhooks from './webhooks/retrieve-secret-webhooks';
68
+ import retrieve_webhooks_headers from './webhooks/headers/retrieve-webhooks-headers';
69
+ import update_webhooks_headers from './webhooks/headers/update-webhooks-headers';
70
+ import create_your_webhook_url from './your-webhook-url/create-your-webhook-url';
62
71
 
63
72
  export const endpoints: Endpoint[] = [];
64
73
 
@@ -121,6 +130,15 @@ addEndpoint(retrieve_brands);
121
130
  addEndpoint(update_brands);
122
131
  addEndpoint(list_brands);
123
132
  addEndpoint(update_images_brands);
133
+ addEndpoint(create_webhooks);
134
+ addEndpoint(retrieve_webhooks);
135
+ addEndpoint(update_webhooks);
136
+ addEndpoint(list_webhooks);
137
+ addEndpoint(delete_webhooks);
138
+ addEndpoint(retrieve_secret_webhooks);
139
+ addEndpoint(retrieve_webhooks_headers);
140
+ addEndpoint(update_webhooks_headers);
141
+ addEndpoint(create_your_webhook_url);
124
142
 
125
143
  export type Filter = {
126
144
  type: 'resource' | 'operation' | 'tag' | 'tool';
@@ -358,7 +358,7 @@ export const tool: Tool = {
358
358
  $ref: '#/$defs/attach_existing_customer',
359
359
  },
360
360
  {
361
- $ref: '#/$defs/create_new_customer',
361
+ $ref: '#/$defs/new_customer',
362
362
  },
363
363
  ],
364
364
  },
@@ -372,9 +372,8 @@ export const tool: Tool = {
372
372
  },
373
373
  required: ['customer_id'],
374
374
  },
375
- create_new_customer: {
375
+ new_customer: {
376
376
  type: 'object',
377
- title: 'Create New Customer',
378
377
  properties: {
379
378
  email: {
380
379
  type: 'string',
@@ -382,11 +381,6 @@ export const tool: Tool = {
382
381
  name: {
383
382
  type: 'string',
384
383
  },
385
- create_new_customer: {
386
- type: 'boolean',
387
- description:
388
- 'When false, the most recently created customer object with the given email is used if exists.\nWhen true, a new customer object is always created\nFalse by default',
389
- },
390
384
  phone_number: {
391
385
  type: 'string',
392
386
  },
@@ -70,6 +70,10 @@ export const tool: Tool = {
70
70
  type: 'boolean',
71
71
  description: 'When true, generates and sends a license key to your customer.\nDefaults to false',
72
72
  },
73
+ metadata: {
74
+ type: 'object',
75
+ description: 'Additional metadata for the product',
76
+ },
73
77
  name: {
74
78
  type: 'string',
75
79
  description: 'Optional name of the product',
@@ -80,6 +80,10 @@ export const tool: Tool = {
80
80
  description:
81
81
  'Whether the product requires a license key.\n\nIf `true`, additional fields related to license key (duration, activations limit, activation message)\nbecome applicable.',
82
82
  },
83
+ metadata: {
84
+ type: 'object',
85
+ description: 'Additional metadata for the product',
86
+ },
83
87
  name: {
84
88
  type: 'string',
85
89
  description: 'Name of the product, optional and must be at most 100 characters.',
@@ -400,7 +400,7 @@ export const tool: Tool = {
400
400
  $ref: '#/$defs/attach_existing_customer',
401
401
  },
402
402
  {
403
- $ref: '#/$defs/create_new_customer',
403
+ $ref: '#/$defs/new_customer',
404
404
  },
405
405
  ],
406
406
  },
@@ -414,9 +414,8 @@ export const tool: Tool = {
414
414
  },
415
415
  required: ['customer_id'],
416
416
  },
417
- create_new_customer: {
417
+ new_customer: {
418
418
  type: 'object',
419
- title: 'Create New Customer',
420
419
  properties: {
421
420
  email: {
422
421
  type: 'string',
@@ -424,11 +423,6 @@ export const tool: Tool = {
424
423
  name: {
425
424
  type: 'string',
426
425
  },
427
- create_new_customer: {
428
- type: 'boolean',
429
- description:
430
- 'When false, the most recently created customer object with the given email is used if exists.\nWhen true, a new customer object is always created\nFalse by default',
431
- },
432
426
  phone_number: {
433
427
  type: 'string',
434
428
  },
@@ -42,6 +42,10 @@ export const tool: Tool = {
42
42
  metadata: {
43
43
  type: 'object',
44
44
  },
45
+ next_billing_date: {
46
+ type: 'string',
47
+ format: 'date-time',
48
+ },
45
49
  status: {
46
50
  $ref: '#/$defs/subscription_status',
47
51
  },
@@ -0,0 +1,105 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { maybeFilter } from 'dodopayments-mcp/filtering';
4
+ import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
5
+
6
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
+ import DodoPayments from 'dodopayments';
8
+
9
+ export const metadata: Metadata = {
10
+ resource: 'webhooks',
11
+ operation: 'write',
12
+ tags: [],
13
+ httpMethod: 'post',
14
+ httpPath: '/webhooks',
15
+ operationId: 'create_webhook',
16
+ };
17
+
18
+ export const tool: Tool = {
19
+ name: 'create_webhooks',
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 a new webhook\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'The webhook\\'s ID.'\n },\n created_at: {\n type: 'string',\n description: 'Created at timestamp'\n },\n description: {\n type: 'string',\n description: 'An example webhook name.'\n },\n metadata: {\n type: 'object',\n description: 'Metadata of the webhook'\n },\n updated_at: {\n type: 'string',\n description: 'Updated at timestamp'\n },\n url: {\n type: 'string',\n description: 'Url endpoint of the webhook'\n },\n disabled: {\n type: 'boolean',\n description: 'Status of the webhook.\\n\\nIf true, events are not sent'\n },\n filter_types: {\n type: 'array',\n description: 'Filter events to the webhook.\\n\\nWebhook event will only be sent for events in the list.',\n items: {\n type: 'string'\n }\n },\n rate_limit: {\n type: 'integer',\n description: 'Configured rate limit'\n }\n },\n required: [ 'id',\n 'created_at',\n 'description',\n 'metadata',\n 'updated_at',\n 'url'\n ]\n}\n```",
22
+ inputSchema: {
23
+ type: 'object',
24
+ properties: {
25
+ url: {
26
+ type: 'string',
27
+ description: 'Url of the webhook',
28
+ },
29
+ description: {
30
+ type: 'string',
31
+ },
32
+ disabled: {
33
+ type: 'boolean',
34
+ description: 'Create the webhook in a disabled state.\n\nDefault is false',
35
+ },
36
+ filter_types: {
37
+ type: 'array',
38
+ description:
39
+ 'Filter events to the webhook.\n\nWebhook event will only be sent for events in the list.',
40
+ items: {
41
+ $ref: '#/$defs/webhook_event_type',
42
+ },
43
+ },
44
+ headers: {
45
+ type: 'object',
46
+ description: 'Custom headers to be passed',
47
+ },
48
+ idempotency_key: {
49
+ type: 'string',
50
+ description: "The request's idempotency key",
51
+ },
52
+ metadata: {
53
+ type: 'object',
54
+ description: 'Metadata to be passed to the webhook\nDefaut is {}',
55
+ },
56
+ rate_limit: {
57
+ type: 'integer',
58
+ },
59
+ jq_filter: {
60
+ type: 'string',
61
+ title: 'jq Filter',
62
+ description:
63
+ '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/).',
64
+ },
65
+ },
66
+ required: ['url'],
67
+ $defs: {
68
+ webhook_event_type: {
69
+ type: 'string',
70
+ description: 'Event types for Dodo events',
71
+ enum: [
72
+ 'payment.succeeded',
73
+ 'payment.failed',
74
+ 'payment.processing',
75
+ 'payment.cancelled',
76
+ 'refund.succeeded',
77
+ 'refund.failed',
78
+ 'dispute.opened',
79
+ 'dispute.expired',
80
+ 'dispute.accepted',
81
+ 'dispute.cancelled',
82
+ 'dispute.challenged',
83
+ 'dispute.won',
84
+ 'dispute.lost',
85
+ 'subscription.active',
86
+ 'subscription.renewed',
87
+ 'subscription.on_hold',
88
+ 'subscription.cancelled',
89
+ 'subscription.failed',
90
+ 'subscription.expired',
91
+ 'subscription.plan_changed',
92
+ 'license_key.created',
93
+ ],
94
+ },
95
+ },
96
+ },
97
+ annotations: {},
98
+ };
99
+
100
+ export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
101
+ const { jq_filter, ...body } = args as any;
102
+ return asTextContentResult(await maybeFilter(jq_filter, await client.webhooks.create(body)));
103
+ };
104
+
105
+ export default { metadata, tool, handler };
@@ -0,0 +1,40 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
4
+
5
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
6
+ import DodoPayments from 'dodopayments';
7
+
8
+ export const metadata: Metadata = {
9
+ resource: 'webhooks',
10
+ operation: 'write',
11
+ tags: [],
12
+ httpMethod: 'delete',
13
+ httpPath: '/webhooks/{webhook_id}',
14
+ operationId: 'delete_webhook',
15
+ };
16
+
17
+ export const tool: Tool = {
18
+ name: 'delete_webhooks',
19
+ description: 'Delete a webhook by id',
20
+ inputSchema: {
21
+ type: 'object',
22
+ properties: {
23
+ webhook_id: {
24
+ type: 'string',
25
+ },
26
+ },
27
+ required: ['webhook_id'],
28
+ },
29
+ annotations: {
30
+ idempotentHint: true,
31
+ },
32
+ };
33
+
34
+ export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
35
+ const { webhook_id, ...body } = args as any;
36
+ const response = await client.webhooks.delete(webhook_id).asResponse();
37
+ return asTextContentResult(await response.text());
38
+ };
39
+
40
+ export default { metadata, tool, handler };
@@ -0,0 +1,49 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { maybeFilter } from 'dodopayments-mcp/filtering';
4
+ import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
5
+
6
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
+ import DodoPayments from 'dodopayments';
8
+
9
+ export const metadata: Metadata = {
10
+ resource: 'webhooks.headers',
11
+ operation: 'read',
12
+ tags: [],
13
+ httpMethod: 'get',
14
+ httpPath: '/webhooks/{webhook_id}/headers',
15
+ operationId: 'get_webhook_headers',
16
+ };
17
+
18
+ export const tool: Tool = {
19
+ name: 'retrieve_webhooks_headers',
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\nGet a webhook by id\n\n# Response Schema\n```json\n{\n type: 'object',\n description: 'The value of the headers is returned in the `headers` field.\\n\\nSensitive headers that have been redacted are returned in the sensitive\\nfield.',\n properties: {\n headers: {\n type: 'object',\n description: 'List of headers configured'\n },\n sensitive: {\n type: 'array',\n description: 'Sensitive headers without the value',\n items: {\n type: 'string'\n }\n }\n },\n required: [ 'headers',\n 'sensitive'\n ]\n}\n```",
22
+ inputSchema: {
23
+ type: 'object',
24
+ properties: {
25
+ webhook_id: {
26
+ type: 'string',
27
+ },
28
+ jq_filter: {
29
+ type: 'string',
30
+ title: 'jq Filter',
31
+ description:
32
+ 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
33
+ },
34
+ },
35
+ required: ['webhook_id'],
36
+ },
37
+ annotations: {
38
+ readOnlyHint: true,
39
+ },
40
+ };
41
+
42
+ export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
43
+ const { webhook_id, jq_filter, ...body } = args as any;
44
+ return asTextContentResult(
45
+ await maybeFilter(jq_filter, await client.webhooks.headers.retrieve(webhook_id)),
46
+ );
47
+ };
48
+
49
+ export default { metadata, tool, handler };
@@ -0,0 +1,42 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
4
+
5
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
6
+ import DodoPayments from 'dodopayments';
7
+
8
+ export const metadata: Metadata = {
9
+ resource: 'webhooks.headers',
10
+ operation: 'write',
11
+ tags: [],
12
+ httpMethod: 'patch',
13
+ httpPath: '/webhooks/{webhook_id}/headers',
14
+ operationId: 'patch_webhook_headers',
15
+ };
16
+
17
+ export const tool: Tool = {
18
+ name: 'update_webhooks_headers',
19
+ description: 'Patch a webhook by id',
20
+ inputSchema: {
21
+ type: 'object',
22
+ properties: {
23
+ webhook_id: {
24
+ type: 'string',
25
+ },
26
+ headers: {
27
+ type: 'object',
28
+ description: 'Object of header-value pair to update or add',
29
+ },
30
+ },
31
+ required: ['webhook_id', 'headers'],
32
+ },
33
+ annotations: {},
34
+ };
35
+
36
+ export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
37
+ const { webhook_id, ...body } = args as any;
38
+ const response = await client.webhooks.headers.update(webhook_id, body).asResponse();
39
+ return asTextContentResult(await response.text());
40
+ };
41
+
42
+ export default { metadata, tool, handler };
@@ -0,0 +1,53 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { maybeFilter } from 'dodopayments-mcp/filtering';
4
+ import { Metadata, asTextContentResult } from 'dodopayments-mcp/tools/types';
5
+
6
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
7
+ import DodoPayments from 'dodopayments';
8
+
9
+ export const metadata: Metadata = {
10
+ resource: 'webhooks',
11
+ operation: 'read',
12
+ tags: [],
13
+ httpMethod: 'get',
14
+ httpPath: '/webhooks',
15
+ operationId: 'list_webhooks',
16
+ };
17
+
18
+ export const tool: Tool = {
19
+ name: 'list_webhooks',
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\nList all webhooks\n\n# Response Schema\n```json\n{\n type: 'object',\n properties: {\n data: {\n type: 'array',\n description: 'List of webhoooks',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n description: 'The webhook\\'s ID.'\n },\n created_at: {\n type: 'string',\n description: 'Created at timestamp'\n },\n description: {\n type: 'string',\n description: 'An example webhook name.'\n },\n metadata: {\n type: 'object',\n description: 'Metadata of the webhook'\n },\n updated_at: {\n type: 'string',\n description: 'Updated at timestamp'\n },\n url: {\n type: 'string',\n description: 'Url endpoint of the webhook'\n },\n disabled: {\n type: 'boolean',\n description: 'Status of the webhook.\\n\\nIf true, events are not sent'\n },\n filter_types: {\n type: 'array',\n description: 'Filter events to the webhook.\\n\\nWebhook event will only be sent for events in the list.',\n items: {\n type: 'string'\n }\n },\n rate_limit: {\n type: 'integer',\n description: 'Configured rate limit'\n }\n },\n required: [ 'id',\n 'created_at',\n 'description',\n 'metadata',\n 'updated_at',\n 'url'\n ]\n }\n },\n done: {\n type: 'boolean',\n description: 'true if no more values are to be fetched.'\n },\n iterator: {\n type: 'string',\n description: 'Cursor pointing to the next paginated object'\n },\n prev_iterator: {\n type: 'string',\n description: 'Cursor pointing to the previous paginated object'\n }\n },\n required: [ 'data',\n 'done'\n ]\n}\n```",
22
+ inputSchema: {
23
+ type: 'object',
24
+ properties: {
25
+ iterator: {
26
+ type: 'string',
27
+ description: 'The iterator returned from a prior invocation',
28
+ },
29
+ limit: {
30
+ type: 'integer',
31
+ description: 'Limit the number of returned items',
32
+ },
33
+ jq_filter: {
34
+ type: 'string',
35
+ title: 'jq Filter',
36
+ description:
37
+ 'A jq filter to apply to the response to include certain fields. Consult the output schema in the tool description to see the fields that are available.\n\nFor example: to include only the `name` field in every object of a results array, you can provide ".results[].name".\n\nFor more information, see the [jq documentation](https://jqlang.org/manual/).',
38
+ },
39
+ },
40
+ required: [],
41
+ },
42
+ annotations: {
43
+ readOnlyHint: true,
44
+ },
45
+ };
46
+
47
+ export const handler = async (client: DodoPayments, args: Record<string, unknown> | undefined) => {
48
+ const { jq_filter, ...body } = args as any;
49
+ const response = await client.webhooks.list(body).asResponse();
50
+ return asTextContentResult(await maybeFilter(jq_filter, await response.json()));
51
+ };
52
+
53
+ export default { metadata, tool, handler };