Skip to main content
Glama
klodr

mercury-invoicing-mcp

mercury_create_internal_transfer

Move money between two Mercury accounts you own. Use to rebalance cash, sweep idle deposits, or fund sub-accounts. Settles immediately with no approval workflow.

Instructions

Move money between two of your own Mercury accounts (e.g. Checking → Savings). Funds stay inside your organisation.

USE WHEN: rebalancing cash between your own Mercury accounts — sweeping idle deposits to Treasury, funding a sub-account before issuing cards, etc. Both accounts must belong to your workspace.

DO NOT USE: to send money to an external counterparty (use mercury_send_money). To request approval-gated movement, use mercury_request_send_money (different surface, external only).

SIDE EFFECTS: moves real money between two accounts you own. Settles immediately, no approval workflow because no external recipient is involved. Persistent ledger entries on both sides. Idempotent via idempotencyKey — auto-generated if omitted, but pass an explicit one to make retries safe.

RETURNS: { id, amount, status, ... } — the booked transfer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceAccountIdYesSource Mercury account ID
destinationAccountIdYesDestination Mercury account ID
amountYesAmount in USD (>= 0.01)
noteNoOptional note attached to the transfer
idempotencyKeyNoUnique key to prevent duplicate transfers. Auto-generated if omitted.

Implementation Reference

  • Handler function for mercury_create_internal_transfer. Makes a POST request to `/transfer` with sourceAccountId, destinationAccountId, amount, optional note, and auto-generated idempotencyKey. Returns the booked transfer result via textResult.
      async ({ idempotencyKey, ...body }) => {
        const idem = idempotencyKey ?? randomUUID();
        const data = await client.post(`/transfer`, { ...body, idempotencyKey: idem });
        return textResult(data);
      },
    );
  • Input schema (Zod) for mercury_create_internal_transfer. Requires: sourceAccountId (UUID), destinationAccountId (UUID), amount (number >= 0.01). Optional: note (string), idempotencyKey (string).
    {
      sourceAccountId: z.string().uuid().describe("Source Mercury account ID"),
      destinationAccountId: z.string().uuid().describe("Destination Mercury account ID"),
      amount: z.number().min(0.01).describe("Amount in USD (>= 0.01)"),
      note: z.string().optional().describe("Optional note attached to the transfer"),
      idempotencyKey: z
        .string()
        .optional()
        .describe("Unique key to prevent duplicate transfers. Auto-generated if omitted."),
    },
  • Registration of the 'mercury_create_internal_transfer' tool via defineTool() inside registerTransactionTools(). Includes the full description/usage instructions for the LLM.
    defineTool(
      server,
      "mercury_create_internal_transfer",
      [
        "Move money between two of your own Mercury accounts (e.g. Checking → Savings). Funds stay inside your organisation.",
        "",
        "USE WHEN: rebalancing cash between your own Mercury accounts — sweeping idle deposits to Treasury, funding a sub-account before issuing cards, etc. Both accounts must belong to your workspace.",
        "",
        "DO NOT USE: to send money to an external counterparty (use `mercury_send_money`). To request approval-gated movement, use `mercury_request_send_money` (different surface, external only).",
        "",
        "SIDE EFFECTS: **moves real money** between two accounts you own. Settles immediately, no approval workflow because no external recipient is involved. Persistent ledger entries on both sides. **Idempotent via `idempotencyKey`** — auto-generated if omitted, but pass an explicit one to make retries safe.",
        "",
        "RETURNS: `{ id, amount, status, ... }` — the booked transfer.",
      ].join("\n"),
      {
        sourceAccountId: z.string().uuid().describe("Source Mercury account ID"),
        destinationAccountId: z.string().uuid().describe("Destination Mercury account ID"),
        amount: z.number().min(0.01).describe("Amount in USD (>= 0.01)"),
        note: z.string().optional().describe("Optional note attached to the transfer"),
        idempotencyKey: z
          .string()
          .optional()
          .describe("Unique key to prevent duplicate transfers. Auto-generated if omitted."),
      },
      async ({ idempotencyKey, ...body }) => {
        const idem = idempotencyKey ?? randomUUID();
        const data = await client.post(`/transfer`, { ...body, idempotencyKey: idem });
        return textResult(data);
      },
    );
  • The defineTool helper wraps the handler with middleware (rate-limiting, dry-run, audit) and registers it on the MCP server via server.registerTool().
    export function defineTool<S extends ZodRawShape>(
      server: McpServer,
      name: string,
      description: string,
      inputSchema: S,
      handler: (args: z.infer<z.ZodObject<S>>) => Promise<ToolResult>,
    ): void {
      const wrapped = wrapToolHandler(name, handler);
      const strictSchema = z.object(inputSchema).strict();
      server.registerTool(name, { description, inputSchema: strictSchema }, wrapped);
    }
  • registerAllTools() calls registerTransactionTools(server, client), which is where mercury_create_internal_transfer gets registered on the MCP server.
    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);
    }
Behavior5/5

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

No annotations given; description fully covers side effects (moves real money, settles immediately, idempotent, ledger entries) and return info.

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?

Front-loaded purpose, clearly structured sections (USE WHEN, DO NOT USE, SIDE EFFECTS, RETURNS), no wasted words.

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?

Covers usage, behavior, parameters, and return format despite no output schema. Complete for a money transfer tool.

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?

Schema covers all 5 parameters (100% coverage). Description adds value by explaining idempotencyKey auto-generation and retry safety.

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?

Clearly states 'Move money between two of your own Mercury accounts' with examples, distinguishing it from sibling tools like mercury_send_money.

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, listing alternatives (mercury_send_money, mercury_request_send_money) and conditions.

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