madeonsol_copytrade_list
List your copy-trade rules. Shows rule count and content based on your plan: 3 for PRO, 20 for ULTRA.
Instructions
List your copy-trade rules. PRO=3 rules, ULTRA=20 rules.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:678-686 (handler)Handler function for the 'madeonsol_copytrade_list' tool. It calls restQuery with GET method to '/copytrade/subscriptions' to list all copy-trade rules.
server.tool( "madeonsol_copytrade_list", "List your copy-trade rules. PRO=3 rules, ULTRA=20 rules.", {}, { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }, async () => ({ content: [{ type: "text" as const, text: await restQuery("GET", "/copytrade/subscriptions") }], }) ); - src/index.ts:681-682 (schema)Schema for madeonsol_copytrade_list — no input parameters (empty object), it simply lists all copy-trade rules.
{}, { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }, - src/index.ts:678-686 (registration)Registration via server.tool() within the hasRestAuth conditional block (requires MADEONSOL_API_KEY) inside the registerTools function.
server.tool( "madeonsol_copytrade_list", "List your copy-trade rules. PRO=3 rules, ULTRA=20 rules.", {}, { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }, async () => ({ content: [{ type: "text" as const, text: await restQuery("GET", "/copytrade/subscriptions") }], }) ); - src/index.ts:451-466 (helper)restQuery helper function used by madeonsol_copytrade_list to make authenticated GET requests to the MadeOnSol REST API (requires MADEONSOL_API_KEY).
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); }