mercury_get_account
Retrieve full details of a specific Mercury deposit account using its ID. Get balances, account number, and status without re-listing all accounts.
Instructions
Retrieve details for a specific Mercury deposit account by ID.
USE WHEN: fetching the full detail of a single account whose ID is already known (typically from mercury_list_accounts). Faster than re-listing when you already have the ID.
DO NOT USE: to enumerate accounts (use mercury_list_accounts). For IO Credit accounts (use the mercury_list_credit_accounts endpoint).
RETURNS: { id, name, kind, status, availableBalance, currentBalance, accountNumber, routingNumber, ... }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accountId | Yes | The Mercury account ID |
Implementation Reference
- src/tools/accounts.ts:42-45 (handler)The async handler function that executes mercury_get_account. Calls client.get('/account/{accountId}') with the UUID accountId parameter and returns the result as text.
async ({ accountId }) => { const data = await client.get(`/account/${accountId}`); return textResult(data); }, - src/tools/accounts.ts:39-41 (schema)Input schema for mercury_get_account: requires a single 'accountId' parameter validated as a UUID via z.uuid().
{ accountId: z.uuid().describe("The Mercury account ID"), }, - src/tools/accounts.ts:27-47 (registration)Tool registration using defineTool() with name 'mercury_get_account', including description, input schema, handler, and annotations (title, readOnlyHint, openWorldHint).
defineTool( server, "mercury_get_account", [ "Retrieve details for a specific Mercury deposit account by ID.", "", "USE WHEN: fetching the full detail of a single account whose ID is already known (typically from `mercury_list_accounts`). Faster than re-listing when you already have the ID.", "", "DO NOT USE: to enumerate accounts (use `mercury_list_accounts`). For IO Credit accounts (use the `mercury_list_credit_accounts` endpoint).", "", "RETURNS: `{ id, name, kind, status, availableBalance, currentBalance, accountNumber, routingNumber, ... }`.", ].join("\n"), { accountId: z.uuid().describe("The Mercury account ID"), }, async ({ accountId }) => { const data = await client.get(`/account/${accountId}`); return textResult(data); }, { title: "Get Account", readOnlyHint: true, openWorldHint: true }, ); - src/tools/_shared.ts:28-54 (helper)The defineTool() helper function that wraps and registers the tool on the MCP server, applying middleware and strict schema validation.
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, ); }