madeonsol_first_touch_subscriptions_update
Update a first-touch subscription's settings: name, filters, delivery mode, webhook, or toggle is_active. Used for Solana KOL trading alerts.
Instructions
Update fields on a first-touch subscription, including is_active toggle. ULTRA only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Subscription UUID | |
| name | No | ||
| filters | No | ||
| delivery_mode | No | ||
| webhook_url | No | ||
| is_active | No |
Implementation Reference
- src/index.ts:925-948 (registration)Registration of the madeonsol_first_touch_subscriptions_update tool via server.tool(). The tool is defined with a schema for id, name, filters, delivery_mode, webhook_url, and is_active, and the handler sends a PATCH request to the MadeOnSol API at /kol/first-touches/subscriptions/:id.
server.tool( "madeonsol_first_touch_subscriptions_update", "Update fields on a first-touch subscription, including is_active toggle. ULTRA only.", { id: z.string().describe("Subscription UUID"), name: z.string().nullable().optional(), filters: z.object({ kol: z.string().optional(), mint_suffix: z.string().optional(), min_first_buy_sol: z.number().min(0).optional(), min_scout_tier: z.enum(["S", "A", "B", "C"]).optional(), min_n_touches: z.number().min(1).optional(), }).optional(), delivery_mode: z.enum(["websocket", "webhook", "both"]).optional(), webhook_url: z.string().url().nullable().optional(), is_active: z.boolean().optional(), }, { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }, async ({ id, ...patch }) => { const body: Record<string, unknown> = {}; for (const [k, v] of Object.entries(patch)) if (v !== undefined) body[k] = v; return { content: [{ type: "text" as const, text: await restQuery("PATCH", `/kol/first-touches/subscriptions/${encodeURIComponent(id)}`, body) }] }; } ); - src/index.ts:928-941 (schema)Zod schema defining the input parameters for the update tool: id (required UUID), and optional fields name, filters, delivery_mode, webhook_url, and is_active.
{ id: z.string().describe("Subscription UUID"), name: z.string().nullable().optional(), filters: z.object({ kol: z.string().optional(), mint_suffix: z.string().optional(), min_first_buy_sol: z.number().min(0).optional(), min_scout_tier: z.enum(["S", "A", "B", "C"]).optional(), min_n_touches: z.number().min(1).optional(), }).optional(), delivery_mode: z.enum(["websocket", "webhook", "both"]).optional(), webhook_url: z.string().url().nullable().optional(), is_active: z.boolean().optional(), }, - src/index.ts:943-948 (handler)Handler function for the update tool. It destructures the 'id' from the rest of the patch fields, builds a body object from non-undefined fields, and calls restQuery with a PATCH method to the MadeOnSol API endpoint /kol/first-touches/subscriptions/:id.
async ({ id, ...patch }) => { const body: Record<string, unknown> = {}; for (const [k, v] of Object.entries(patch)) if (v !== undefined) body[k] = v; return { content: [{ type: "text" as const, text: await restQuery("PATCH", `/kol/first-touches/subscriptions/${encodeURIComponent(id)}`, body) }] }; } ); - src/index.ts:451-466 (helper)Helper function restQuery that the update handler delegates to. It sends an HTTP request with JSON body and Bearer auth headers to the MadeOnSol API and returns formatted JSON or an error string.
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); }