pause_webhook
Pause webhook subscription deliveries to stop the poller from processing new events while retaining existing attachments.
Instructions
[write] Pause deliveries for a webhook subscription. Existing attachments stay; the poller skips this subscriber until resumed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| webhook_id | Yes | Webhook subscriber UUID |
Implementation Reference
- src/tools.ts:80-86 (handler)The pause_webhook tool definition with its handler function that sends a POST request to /api/v1/webhooks/{webhook_id}/pause.
name: "pause_webhook", description: "Pause deliveries for a webhook subscription. Existing attachments stay; the poller skips this subscriber until resumed.", scope: "write", inputSchema: WebhookIdInput, handler: ({ webhook_id }: any, c) => c.request("POST", `/api/v1/webhooks/${webhook_id}/pause`), - src/tools.ts:23-25 (schema)The input schema (WebhookIdInput) used by pause_webhook, requiring a 'webhook_id' string field.
const WebhookIdInput = z.object({ webhook_id: z.string().describe("Webhook subscriber UUID"), }); - src/index.ts:37-43 (registration)Tool listing registration: TOOLS array (including pause_webhook) is converted to JSON schemas and exposed via ListToolsRequestSchema.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS.map((t) => ({ name: t.name, description: `[${t.scope}] ${t.description}`, inputSchema: zodToJsonSchema(t.inputSchema, { target: "openApi3" }), })), })); - src/index.ts:45-86 (registration)Tool call handler registration: dispatches to TOOLS.find, validates input via Zod, and calls the handler (including pause_webhook).
server.setRequestHandler(CallToolRequestSchema, async (req) => { const tool = TOOLS.find((t) => t.name === req.params.name); if (!tool) { return { isError: true, content: [{ type: "text", text: `Unknown tool: ${req.params.name}` }], }; } const parsed = tool.inputSchema.safeParse(req.params.arguments ?? {}); if (!parsed.success) { return { isError: true, content: [ { type: "text", text: `Invalid arguments: ${parsed.error.message}`, }, ], }; } try { const result = await tool.handler(parsed.data, client); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; } catch (err) { const e = err as Error & { status?: number; body?: unknown }; return { isError: true, content: [ { type: "text", text: JSON.stringify( { error: e.message, status: e.status, body: e.body }, null, 2, ), }, ], }; } }); - src/client.ts:23-56 (helper)The FeedbagelClient.request() helper method used by pause_webhook's handler to make the actual HTTP POST call.
async request( method: string, path: string, body?: unknown, ): Promise<unknown> { const res = await fetch(`${this.baseUrl}${path}`, { method, headers: { Authorization: `Bearer ${this.apiKey}`, ...(body !== undefined ? { "content-type": "application/json" } : {}), }, body: body !== undefined ? JSON.stringify(body) : undefined, }); const text = await res.text(); let json: unknown = undefined; try { json = text ? JSON.parse(text) : undefined; } catch { json = { raw: text }; } if (!res.ok) { // Surface 429 and 4xx details verbatim so the agent sees the cap info. const err: Error & { status?: number; body?: unknown } = new Error( `HTTP ${res.status} ${res.statusText}`, ); err.status = res.status; err.body = json; throw err; } return json; } }