Skip to main content
Glama
klodr

mercury-invoicing-mcp

mercury_update_recipient

Update an existing recipient's legal name, nickname, contact emails, or default payment method. Use to modify payment routing without recreating the recipient.

Instructions

Update an existing payment recipient (legal name, nickname, contact emails, default payment method).

USE WHEN: amending a recipient's contact info or default payment method after creation. Useful for re-routing future payments to a recipient via a different method (e.g. ACH → wire) without recreating it.

DO NOT USE: to change the bank account number / routing number — that requires a fresh recipient (security policy on Mercury's side). Use mercury_add_recipient for the new banking info.

SIDE EFFECTS: writes the recipient record on Mercury. Persistent. Only the fields you pass are changed. Mercury endpoint is POST /recipient/{id} (SINGULAR — not the plural /recipients/{id}).

RETURNS: { id, name, nickname, defaultPaymentMethod, ... } — the updated recipient.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recipientIdYesThe recipient ID
nameNoRecipient legal name
nicknameNoInternal nickname
contactEmailNoPrimary contact email
emailsNoList of email addresses
defaultPaymentMethodNo

Implementation Reference

  • The handler function for mercury_update_recipient. It extracts recipientId from args, sends a POST request to /recipient/{recipientId} (singular form), and returns the sanitized result.
    async ({ recipientId, ...body }) => {
      const data = await client.post(`/recipient/${recipientId}`, body);
      return textResult(data);
    },
  • Zod schema defining the input parameters for mercury_update_recipient: required recipientId (UUID), optional name, nickname, contactEmail, emails array, and defaultPaymentMethod enum.
    {
      recipientId: z.uuid().describe("The recipient ID"),
      name: z.string().optional().describe("Recipient legal name"),
      nickname: z.string().optional().describe("Internal nickname"),
      contactEmail: z.email().optional().describe("Primary contact email"),
      emails: z.array(z.email()).optional().describe("List of email addresses"),
      defaultPaymentMethod: z
        .enum(["domesticAch", "internationalWire", "domesticWire", "check"])
        .optional(),
    },
  • Registration of the tool via defineTool() call inside registerRecipientTools(), mapping name 'mercury_update_recipient' to its schema, handler, and annotations.
    defineTool(
      server,
      "mercury_update_recipient",
      [
        "Update an existing payment recipient (legal name, nickname, contact emails, default payment method).",
        "",
        "USE WHEN: amending a recipient's contact info or default payment method after creation. Useful for re-routing future payments to a recipient via a different method (e.g. ACH → wire) without recreating it.",
        "",
        "DO NOT USE: to change the bank account number / routing number — that requires a fresh recipient (security policy on Mercury's side). Use `mercury_add_recipient` for the new banking info.",
        "",
        "SIDE EFFECTS: writes the recipient record on Mercury. Persistent. Only the fields you pass are changed. Mercury endpoint is `POST /recipient/{id}` (SINGULAR — not the plural `/recipients/{id}`).",
        "",
        "RETURNS: `{ id, name, nickname, defaultPaymentMethod, ... }` — the updated recipient.",
      ].join("\n"),
      {
        recipientId: z.uuid().describe("The recipient ID"),
        name: z.string().optional().describe("Recipient legal name"),
        nickname: z.string().optional().describe("Internal nickname"),
        contactEmail: z.email().optional().describe("Primary contact email"),
        emails: z.array(z.email()).optional().describe("List of email addresses"),
        defaultPaymentMethod: z
          .enum(["domesticAch", "internationalWire", "domesticWire", "check"])
          .optional(),
      },
      async ({ recipientId, ...body }) => {
        const data = await client.post(`/recipient/${recipientId}`, body);
        return textResult(data);
      },
      { title: "Update Recipient", destructiveHint: false, openWorldHint: true },
    );
  • Rate-limit bucket mapping: mercury_update_recipient is mapped to the 'recipients_update' bucket, which has a daily limit of 2 and monthly limit of 15.
    mercury_update_recipient: "recipients_update",
  • The defineTool helper used to register all tools. It wraps the handler with middleware (rate-limiting, dry-run, audit) via wrapToolHandler, then registers on the MCP server.
    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,
      );
    }
Behavior4/5

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

Discloses that the tool writes persistently and only modifies passed fields. Mentions the exact endpoint path (singular vs plural) and specifies the return shape. Annotations are consistent; no contradiction.

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?

The description is well-structured with clear sections: main purpose, USE WHEN, DO NOT USE, SIDE EFFECTS, RETURNS. Every sentence is necessary and concise, with no wasted words.

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

Completeness4/5

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

Covers the tool's purpose, allowed updates, exclusions, side effects, and return format. With no output schema, the return example is helpful. Lacks details on error handling or idempotency, but these are typical in API context.

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?

The description lists the updatable fields, matching the schema. It adds context that these are contact details and default payment method. Since schema coverage is 83%, the description supplements without redundancy.

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 'Update an existing payment recipient' and lists the updatable fields. It explicitly distinguishes from adding a new recipient, especially for changing bank account numbers, which prevents misuse.

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?

Provides explicit 'USE WHEN' and 'DO NOT USE' sections. It gives a concrete use case (re-routing payments via different method) and directs to the sibling tool 'mercury_add_recipient' for prohibited changes.

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