manage_subscription
Cancel, pause, or resume subscriptions on the402.ai marketplace. Cancel maintains access until current period ends. Requires subscription ID and action selection.
Instructions
Manage your subscription on the402.ai — cancel, pause auto-renewal, or resume a paused subscription. Cancelling still gives access until the current period ends. Requires API key.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| subscription_id | Yes | The subscription ID | |
| action | Yes | cancel = end at period end, pause = stop auto-renewal, resume = restart auto-renewal, details = view subscription info |
Implementation Reference
- src/tools/subscriptions.ts:43-75 (handler)Implementation of the manage_subscription tool which handles subscription management actions like cancel, pause, resume, or fetching details.
server.tool( "manage_subscription", "Manage your subscription on the402.ai — cancel, pause auto-renewal, or resume a paused subscription. Cancelling still gives access until the current period ends. Requires API key.", { subscription_id: z.string().describe("The subscription ID"), action: z .enum(["cancel", "pause", "resume", "details"]) .describe( "cancel = end at period end, pause = stop auto-renewal, resume = restart auto-renewal, details = view subscription info" ), }, async ({ subscription_id, action }) => { if (action === "details") { const result = await client.authGet( `/v1/subscriptions/${subscription_id}` ); return { content: [ { type: "text" as const, text: JSON.stringify(result, null, 2) }, ], }; } const result = await client.authPost( `/v1/subscriptions/${subscription_id}/${action}` ); return { content: [ { type: "text" as const, text: JSON.stringify(result, null, 2) }, ], }; } );