Skip to main content
Glama
klodr

mercury-invoicing-mcp

mercury_list_webhooks

Read-only

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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);
    },
  • Empty schema object (no input parameters) for mercury_list_webhooks.
    {},
  • 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 },
      );
  • 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,
      );
    }
  • 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);
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint and openWorldHint. Description adds context about the return structure and clarifies that webhook delivery history is not accessible via API, going beyond what annotations convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise paragraphs with clear headings (USE WHEN, DO NOT USE, RETURNS). Every sentence is informative and necessary.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a parameter-less tool with no output schema, the description fully covers purpose, usage, and return structure. No gaps remain.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, so the description does not need to elaborate. It adds value by specifying the return format, which compensates for the lack of an output schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'List all webhook endpoints' with a specific verb and resource. It distinguishes this tool from siblings like get, create, delete, and update webhooks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Includes explicit 'USE WHEN' and 'DO NOT USE' sections, providing concrete scenarios (audit, finding ID before update/delete, etc.) and excluding delivery history, which only the dashboard provides.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/klodr/mercury-invoicing-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server