mercury_get_account
Retrieve full details for a specific Mercury deposit account using its ID. Faster than re-listing accounts when you already have the ID. Returns balance, status, account and routing numbers.
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:26-45 (handler)The main handler function that executes the mercury_get_account tool logic. It calls client.get('/account/{accountId}') with the provided accountId UUID and returns the result via textResult.
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.string().uuid().describe("The Mercury account ID"), }, async ({ accountId }) => { const data = await client.get(`/account/${accountId}`); return textResult(data); }, ); - src/tools/accounts.ts:38-40 (schema)Zod input schema requiring a single 'accountId' parameter of type UUID string with a description.
{ accountId: z.string().uuid().describe("The Mercury account ID"), }, - src/tools/accounts.ts:26-45 (registration)The tool 'mercury_get_account' is registered via defineTool in the registerAccountTools function, which is called from src/tools/index.ts's registerAllTools.
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.string().uuid().describe("The Mercury account ID"), }, async ({ accountId }) => { const data = await client.get(`/account/${accountId}`); return textResult(data); }, ); - src/tools/_shared.ts:29-39 (helper)The defineTool helper that registers the tool on the MCP server with name, description, inputSchema, and a wrapped handler.
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); }