madeonsol_create_webhook
Register a webhook URL to get real-time push notifications for KOL trades and deployer alerts. Requires Pro/Ultra subscription.
Instructions
Register a webhook URL to receive real-time push notifications for KOL trades and deployer alerts. Requires Pro/Ultra subscription.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | HTTPS webhook URL to receive events | |
| events | Yes | Event types to subscribe to | |
| min_sol | No | Optional: minimum SOL amount filter (for kol:trade) | |
| action | No | Optional: filter by buy or sell only | |
| deployer_tier | No | Optional: filter by deployer tiers, e.g. ['elite', 'good'] |
Implementation Reference
- src/index.ts:481-487 (handler)The handler function for madeonsol_create_webhook. It sends a POST request to /api/v1/webhooks with url, events, and optional filters (min_sol, action, deployer_tier) via the restQuery helper.
async ({ url, events, min_sol, action, deployer_tier }) => { const filters: Record<string, unknown> = {}; if (min_sol) filters.min_sol = min_sol; if (action) filters.action = action; if (deployer_tier) filters.deployer_tier = deployer_tier; return { content: [{ type: "text" as const, text: await restQuery("POST", "/webhooks", { url, events, filters }) }] }; } - src/index.ts:473-479 (schema)Zod schema for madeonsol_create_webhook: requires url (HTTPS), events (array of kol:trade|kol:coordination|deployer:alert|deployer:bond), and optional min_sol, action, deployer_tier.
{ url: z.string().url().describe("HTTPS webhook URL to receive events"), events: z.array(z.enum(["kol:trade", "kol:coordination", "deployer:alert", "deployer:bond"])).min(1).describe("Event types to subscribe to"), min_sol: z.number().optional().describe("Optional: minimum SOL amount filter (for kol:trade)"), action: z.enum(["buy", "sell"]).optional().describe("Optional: filter by buy or sell only"), deployer_tier: z.array(z.string()).optional().describe("Optional: filter by deployer tiers, e.g. ['elite', 'good']"), }, - src/index.ts:470-488 (registration)Tool registration via server.tool() with name 'madeonsol_create_webhook', description, schema annotations, and the handler callback.
server.tool( "madeonsol_create_webhook", "Register a webhook URL to receive real-time push notifications for KOL trades and deployer alerts. Requires Pro/Ultra subscription.", { url: z.string().url().describe("HTTPS webhook URL to receive events"), events: z.array(z.enum(["kol:trade", "kol:coordination", "deployer:alert", "deployer:bond"])).min(1).describe("Event types to subscribe to"), min_sol: z.number().optional().describe("Optional: minimum SOL amount filter (for kol:trade)"), action: z.enum(["buy", "sell"]).optional().describe("Optional: filter by buy or sell only"), deployer_tier: z.array(z.string()).optional().describe("Optional: filter by deployer tiers, e.g. ['elite', 'good']"), }, webhookAnnotations, async ({ url, events, min_sol, action, deployer_tier }) => { const filters: Record<string, unknown> = {}; if (min_sol) filters.min_sol = min_sol; if (action) filters.action = action; if (deployer_tier) filters.deployer_tier = deployer_tier; return { content: [{ type: "text" as const, text: await restQuery("POST", "/webhooks", { url, events, filters }) }] }; } ); - src/index.ts:451-466 (helper)The restQuery helper function used by the handler to make REST API calls with authentication headers.
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); }