Delete a webhook
lob_webhooks_deleteRemove a webhook subscription by providing its ID. Use to manage webhook endpoints.
Instructions
Delete a webhook subscription.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Webhook ID (`ep_…`). |
Implementation Reference
- src/tools/webhooks.ts:96-97 (handler)The handler function for lob_webhooks_delete that executes a DELETE request to /webhooks/{id}
handler: async ({ id }) => lob.request({ method: "DELETE", path: `/webhooks/${id}` }), }); - src/tools/webhooks.ts:95-95 (schema)Input schema for lob_webhooks_delete — requires a webhook ID matching pattern (whk_ or ep_)
inputSchema: { id: WH_ID }, - src/tools/webhooks.ts:91-97 (registration)Registration of the lob_webhooks_delete tool via registerTool in the registerWebhookTools function
registerTool(server, { name: "lob_webhooks_delete", annotations: { title: "Delete a webhook", ...ToolAnnotationPresets.destructive }, description: "Delete a webhook subscription.", inputSchema: { id: WH_ID }, handler: async ({ id }) => lob.request({ method: "DELETE", path: `/webhooks/${id}` }), }); - src/tools/register.ts:44-46 (registration)The top-level registration that wires webhook tools (including lob_webhooks_delete) into the MCP server
registerWebhookTools(server, lob); registerSpecsResources(server); } - src/tools/helpers.ts:85-117 (helper)The registerTool helper that wraps the handler with error handling and registers it on the MCP server
export function registerTool<TShape extends ZodRawShape>( server: McpServer, def: ToolDefinition<TShape>, ): void { const a = def.annotations ?? {}; server.registerTool( def.name, { title: a.title ?? def.name, description: def.description, inputSchema: def.inputSchema, annotations: { ...a, // Lob is always external; default the hint accordingly. openWorldHint: a.openWorldHint ?? true, }, }, // The SDK's ToolCallback type is parameterised over the exact ZodRawShape and // resists the generic erasure here. The runtime contract (validated args in, // CallToolResult out) is correct, so we bridge the type boundary with `as never`. (async (args: unknown, serverCtx: unknown): Promise<CallToolResult> => { try { const result = await def.handler(args as never, serverCtx); return { content: [{ type: "text", text: stringifyResult(result) }] }; } catch (err) { return { isError: true, content: [{ type: "text", text: formatErrorForTool(err) }], }; } }) as never, ); }