mercury_list_webhooks
List all webhook endpoints in your Mercury workspace for audit, finding IDs before updates, or verifying registered delivery targets.
Instructions
List all webhook endpoints configured for your Mercury workspace.
USE WHEN: enumerating registered webhook endpoints — for audit, finding a webhook ID before update/delete, or to confirm a delivery target is registered.
DO NOT USE: to inspect webhook delivery history (Mercury exposes that only via the dashboard, not the API).
RETURNS: { webhooks: [{ id, url, status, events, ... }] }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/webhooks.ts:137-140 (handler)The async handler that executes the tool logic — calls client.get('/webhooks') to list all webhooks.
async () => { const data = await client.get("/webhooks"); return textResult(data); }, - src/tools/webhooks.ts:136-136 (schema)Empty schema object (no input parameters) for mercury_list_webhooks.
{}, - src/tools/webhooks.ts:123-142 (registration)The defineTool call that registers 'mercury_list_webhooks' with the server, including description, schema, and annotations.
export function registerWebhookTools(server: McpServer, client: MercuryClient): void { defineTool( server, "mercury_list_webhooks", [ "List all webhook endpoints configured for your Mercury workspace.", "", "USE WHEN: enumerating registered webhook endpoints — for audit, finding a webhook ID before update/delete, or to confirm a delivery target is registered.", "", "DO NOT USE: to inspect webhook delivery history (Mercury exposes that only via the dashboard, not the API).", "", "RETURNS: `{ webhooks: [{ id, url, status, events, ... }] }`.", ].join("\n"), {}, async () => { const data = await client.get("/webhooks"); return textResult(data); }, { title: "List Webhooks", readOnlyHint: true, openWorldHint: true }, ); - src/tools/_shared.ts:28-54 (helper)The defineTool helper function that wraps tool registration on the McpServer.
export function defineTool<S extends ZodRawShape>( server: McpServer, name: string, description: string, inputSchema: S, handler: (args: z.infer<z.ZodObject<S>>) => Promise<ToolResult>, annotations: ToolAnnotations, ): void { const wrapped = wrapToolHandler(name, handler); const strictSchema = z.object(inputSchema).strict(); // MCP behavioral annotations (readOnlyHint / destructiveHint / // idempotentHint / openWorldHint) — declared machine-readable so // hosts and rubrics (TDQS / Glama Behavior dimension) can detect // tool semantics without scraping the prose description. Required // (not optional) so every new tool ships with explicit semantics — // forgetting the annotation now fails typecheck instead of // silently shipping a tool with no hint set. // The MCP SDK overloads `registerTool` with shape narrowing the runtime // strict-schema and the wrapped callback can't satisfy through generics. // Both casts are runtime-safe — the signatures only diverge at the type // level. Asserted by the existing tool-registration tests. (server.registerTool as unknown as (...a: unknown[]) => unknown)( name, { description, inputSchema: strictSchema, annotations }, wrapped, ); } - src/tools/index.ts:20-38 (registration)The registerAllTools function that calls registerWebhookTools as part of full tool registration.
export function registerAllTools(server: McpServer, client: MercuryClient): void { // Banking registerAccountTools(server, client); registerCardTools(server, client); registerCreditTools(server, client); registerTransactionTools(server, client); registerRecipientTools(server, client); registerStatementTools(server, client); registerTreasuryTools(server, client); registerCategoryTools(server, client); registerOrganizationTools(server, client); // Accounts Receivable (Invoicing) — requires Mercury Plus registerInvoiceTools(server, client); registerCustomerTools(server, client); // Webhooks registerWebhookTools(server, client); }