Skip to main content
Glama
klodr

mercury-invoicing-mcp

mercury_get_transaction

Read-only

Retrieve the full details of a specific Mercury deposit account transaction using its unique ID. Get amount, status, counterparty, and more without relisting all transactions.

Instructions

Retrieve a specific transaction by ID for a Mercury deposit account.

USE WHEN: fetching the full detail of one transaction whose ID is already known (typically from mercury_list_transactions). Faster than relisting + filtering.

DO NOT USE: to enumerate transactions (use mercury_list_transactions). For IO Credit transactions, use mercury_list_credit_transactions and filter by id client-side.

RETURNS: { id, amount, status, postedAt, counterpartyName, memo, ... }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountIdYesThe Mercury account ID
transactionIdYesThe transaction ID

Implementation Reference

  • Tool registration for 'mercury_get_transaction' via defineTool() with description, input schema (accountId, transactionId), and readOnly+openWorld annotations.
    defineTool(
      server,
      "mercury_get_transaction",
      [
        "Retrieve a specific transaction by ID for a Mercury deposit account.",
        "",
        "USE WHEN: fetching the full detail of one transaction whose ID is already known (typically from `mercury_list_transactions`). Faster than relisting + filtering.",
        "",
        "DO NOT USE: to enumerate transactions (use `mercury_list_transactions`). For IO Credit transactions, use `mercury_list_credit_transactions` and filter by id client-side.",
        "",
        "RETURNS: `{ id, amount, status, postedAt, counterpartyName, memo, ... }`.",
      ].join("\n"),
      {
        accountId: z.uuid().describe("The Mercury account ID"),
        transactionId: z.uuid().describe("The transaction ID"),
      },
      async ({ accountId, transactionId }) => {
        const data = await client.get(`/account/${accountId}/transaction/${transactionId}`);
        return textResult(data);
      },
      { title: "Get Transaction", readOnlyHint: true, openWorldHint: true },
    );
  • Handler function that calls client.get('/account/${accountId}/transaction/${transactionId}') and returns textResult(data).
      async ({ accountId, transactionId }) => {
        const data = await client.get(`/account/${accountId}/transaction/${transactionId}`);
        return textResult(data);
      },
      { title: "Get Transaction", readOnlyHint: true, openWorldHint: true },
    );
  • Input schema defining accountId (uuid) and transactionId (uuid) as required parameters for the tool.
    {
      accountId: z.uuid().describe("The Mercury account ID"),
      transactionId: z.uuid().describe("The transaction ID"),
    },
  • The defineTool() helper that registers the tool on the MCP server with wrapped handler and strict schema.
    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,
      );
    }
  • Calls registerTransactionTools(server, client) to register all transaction tools including mercury_get_transaction.
      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?

Description aligns with readOnlyHint and openWorldHint annotations, adds context on performance (faster than relisting) and return structure. No contradictions.

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?

Description is compact with clear sections (purpose, usage, returns). Every sentence adds value; no fluff.

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?

Despite lacking output schema, description lists expected return fields. For a simple single-resource fetch, this is complete.

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?

Schema covers 100% of parameters with descriptions. Description does not add extra meaning beyond schema; merely implies usage of accountId and transactionId.

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 transaction by ID for a Mercury deposit account.' Distinguishes from sibling tools like mercury_list_transactions and mercury_list_credit_transactions.

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 conditions, including specific alternative tools for enumeration and IO Credit transactions.

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