madeonsol_copytrade_delete
Delete a copy-trade rule permanently by specifying its subscription id.
Instructions
Delete a copy-trade rule permanently.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Subscription id |
Implementation Reference
- src/index.ts:746-754 (registration)Tool registration for 'madeonsol_copytrade_delete' on the MCP server via server.tool()
server.tool( "madeonsol_copytrade_delete", "Delete a copy-trade rule permanently.", { id: z.number().describe("Subscription id") }, { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true }, async ({ id }) => ({ content: [{ type: "text" as const, text: await restQuery("DELETE", `/copytrade/subscriptions/${id}`) }], }) ); - src/index.ts:749-750 (schema)Input schema for the tool: accepts a single 'id' parameter (number, subscription id)
{ id: z.number().describe("Subscription id") }, { readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true }, - src/index.ts:751-754 (handler)Handler function: sends DELETE request to /copytrade/subscriptions/{id} via restQuery helper
async ({ id }) => ({ content: [{ type: "text" as const, text: await restQuery("DELETE", `/copytrade/subscriptions/${id}`) }], }) ); - src/index.ts:451-466 (helper)restQuery helper: generic HTTP request function that handles auth headers, JSON serialization, and error formatting
async function restQuery(method: string, path: string, body?: unknown): Promise<string> { const headers: Record<string, string> = { "Content-Type": "application/json", ...apiKeyHeaders(), }; const res = await fetch(`${BASE_URL}/api/v1${path}`, { method, headers, ...(body ? { body: JSON.stringify(body) } : {}), }); if (!res.ok) { const text = await res.text().catch(() => ""); return `Error ${res.status}: ${text}`; } return JSON.stringify(await res.json(), null, 2); }