madeonsol_coordination_alerts_update
Update coordination alert rules: adjust parameters like minimum KOLs, time window, score threshold, and toggle active status.
Instructions
Update fields on a coordination alert rule, including is_active toggle.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Rule UUID | |
| name | No | ||
| min_kols | No | ||
| window_minutes | No | ||
| min_score | No | ||
| include_majors | No | ||
| cooldown_min | No | ||
| score_jump_break | No | ||
| delivery_mode | No | ||
| webhook_url | No | ||
| is_active | No |
Implementation Reference
- src/index.ts:820-842 (registration)Tool registration via server.tool() — binds the tool name 'madeonsol_coordination_alerts_update' to its schema and handler.
server.tool( "madeonsol_coordination_alerts_update", "Update fields on a coordination alert rule, including is_active toggle.", { id: z.string().describe("Rule UUID"), name: z.string().nullable().optional(), min_kols: z.number().min(2).max(50).optional(), window_minutes: z.number().min(1).max(60).optional(), min_score: z.number().min(0).max(100).optional(), include_majors: z.boolean().optional(), cooldown_min: z.number().min(1).optional(), score_jump_break: z.number().min(1).max(100).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/coordination/alerts/${encodeURIComponent(id)}`, body) }] }; } ); - src/index.ts:823-835 (schema)Zod schema defining the input parameters for the update tool: id (Rule UUID, required), and optional fields for name, min_kols, window_minutes, min_score, include_majors, cooldown_min, score_jump_break, delivery_mode, webhook_url, is_active.
{ id: z.string().describe("Rule UUID"), name: z.string().nullable().optional(), min_kols: z.number().min(2).max(50).optional(), window_minutes: z.number().min(1).max(60).optional(), min_score: z.number().min(0).max(100).optional(), include_majors: z.boolean().optional(), cooldown_min: z.number().min(1).optional(), score_jump_break: z.number().min(1).max(100).optional(), delivery_mode: z.enum(["websocket", "webhook", "both"]).optional(), webhook_url: z.string().url().nullable().optional(), is_active: z.boolean().optional(), }, - src/index.ts:837-841 (handler)Handler function — collects optional fields into a body object, then sends a PATCH request to /api/v1/kol/coordination/alerts/{id} via the restQuery helper.
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/coordination/alerts/${encodeURIComponent(id)}`, body) }] }; } - src/index.ts:451-466 (helper)Helper function restQuery — makes authenticated REST API requests to the MadeOnSol API (under /api/v1/). Used by the update handler to PATCH the coordination alert rule.
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); }