Skip to main content
Glama
klodr

mercury-invoicing-mcp

mercury_get_customer

Retrieve full profile of a specific accounts receivable customer by ID. Returns name, email, address, and other details. Use when customer ID is known to avoid listing and filtering.

Instructions

Retrieve a specific Accounts Receivable customer by ID.

USE WHEN: fetching the full detail of one customer whose ID is already known. Faster than relisting + filtering when you have the ID.

DO NOT USE: to enumerate customers (use mercury_list_customers). For payment recipients use mercury_list_recipients (different surface).

RETURNS: { id, name, email, address, ... }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customerIdYesCustomer ID

Implementation Reference

  • The actual handler function for 'mercury_get_customer'. It takes a customerId (UUID), performs a GET request to `/ar/customers/${customerId}` via the MercuryClient, and returns the sanitized JSON result.
    async ({ customerId }) => {
      const data = await client.get(`/ar/customers/${customerId}`);
      return textResult(data);
    },
  • Input schema for 'mercury_get_customer' — expects a single required 'customerId' field validated as a UUID string.
      customerId: z.string().uuid().describe("Customer ID"),
    },
  • The tool is registered via defineTool() inside registerCustomerTools() in src/tools/customers.ts, which calls server.registerTool under the hood (via _shared.ts).
    defineTool(
      server,
      "mercury_get_customer",
      [
        "Retrieve a specific Accounts Receivable customer by ID.",
        "",
        "USE WHEN: fetching the full detail of one customer whose ID is already known. Faster than relisting + filtering when you have the ID.",
        "",
        "DO NOT USE: to enumerate customers (use `mercury_list_customers`). For payment recipients use `mercury_list_recipients` (different surface).",
        "",
        "RETURNS: `{ id, name, email, address, ... }`.",
      ].join("\n"),
      {
        customerId: z.string().uuid().describe("Customer ID"),
      },
      async ({ customerId }) => {
        const data = await client.get(`/ar/customers/${customerId}`);
        return textResult(data);
      },
    );
  • registerCustomerTools is called from src/tools/index.ts (line 34) to register all customer tools including mercury_get_customer on the MCP server.
    export function registerCustomerTools(server: McpServer, client: MercuryClient): void {
      defineTool(
        server,
        "mercury_list_customers",
        [
          "List Accounts Receivable customers, with cursor-based pagination.",
          "",
          "USE WHEN: enumerating AR customers before creating an invoice (need a `customerId` for `mercury_create_invoice`), or for a customer-level audit. Use `startAfter` / `endBefore` for paging beyond the limit.",
          "",
          "DO NOT USE: for payment recipients (`mercury_list_recipients` is the bank-payment counterparty list, distinct from AR customers). For one customer whose ID is known, prefer `mercury_get_customer`.",
          "",
          "RETURNS: `{ customers: [{ id, name, email, address, ... }] }`.",
        ].join("\n"),
        {
          limit: z.number().int().min(1).max(1000).optional().describe("Max results (1-1000)"),
          order: z.enum(["asc", "desc"]).optional(),
          startAfter: z.string().uuid().optional().describe("Pagination cursor (forward)"),
          endBefore: z.string().uuid().optional().describe("Pagination cursor (reverse)"),
        },
        async (args) => {
          const query: Record<string, string | number | undefined> = {
  • 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);
    }
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses return shape ('{ id, name, email, address, ... }') and implies read-only behavior via 'Retrieve'. Lacks explicit disclosure of side effects or auth, but sufficient for a read operation.

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?

Extremely concise: 4 sentences, bullet-style, front-loaded. Every sentence is essential and adds value.

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?

Given low complexity (1 param, no output schema), description covers purpose, usage guidelines, and return format completely.

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

Parameters3/5

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

Input schema already provides full description, format, and pattern for customerId. Description adds no additional meaning beyond 'by ID'. Baseline 3 due to 100% schema coverage.

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 'Retrieve a specific Accounts Receivable customer by ID', specifying verb and resource. Differentiates from sibling tools like mercury_list_customers and mercury_list_recipients.

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?

Explicitly provides USE WHEN and DO NOT USE sections, naming alternatives (mercury_list_customers for enumeration, mercury_list_recipients for payment recipients).

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