mercury_list_credit_accounts
Retrieve Mercury IO credit card accounts to fetch balances, statement closing dates, or account IDs for use in transaction queries.
Instructions
List Mercury IO Credit card accounts (charge cards, distinct from deposit accounts).
USE WHEN: enumerating IO Credit accounts to find their balance, statement closing date, or to feed an ID into mercury_list_credit_transactions. Wraps GET /credit (documented under Credit › List all credit accounts in the Mercury API reference).
DO NOT USE: for deposit accounts (checking/savings/treasury) — use mercury_list_accounts, which hits a different endpoint (/accounts).
RETURNS: { accounts: [{ id, status, availableBalance, currentBalance, ... }] }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/credit.ts:38-41 (handler)The handler function that executes the tool logic: calls client.get('/credit') and returns the result as text.
async () => { const data = await client.get("/credit"); return textResult(data); }, - src/tools/credit.ts:37-37 (schema)Input schema: empty object ({}) since the tool takes no arguments.
{}, - src/tools/credit.ts:24-43 (registration)The tool is registered via defineTool() inside registerCreditTools(), with name 'mercury_list_credit_accounts', description, empty schema, handler, and annotations (readOnlyHint: true, openWorldHint: true).
export function registerCreditTools(server: McpServer, client: MercuryClient): void { defineTool( server, "mercury_list_credit_accounts", [ "List Mercury IO Credit card accounts (charge cards, distinct from deposit accounts).", "", "USE WHEN: enumerating IO Credit accounts to find their balance, statement closing date, or to feed an ID into `mercury_list_credit_transactions`. Wraps `GET /credit` (documented under Credit › List all credit accounts in the Mercury API reference).", "", "DO NOT USE: for deposit accounts (checking/savings/treasury) — use `mercury_list_accounts`, which hits a different endpoint (`/accounts`).", "", "RETURNS: `{ accounts: [{ id, status, availableBalance, currentBalance, ... }] }`.", ].join("\n"), {}, async () => { const data = await client.get("/credit"); return textResult(data); }, { title: "List Credit Accounts", readOnlyHint: true, openWorldHint: true }, ); - src/tools/index.ts:20-24 (registration)registerAllTools() calls registerCreditTools() to register all credit-related tools including mercury_list_credit_accounts.
export function registerAllTools(server: McpServer, client: MercuryClient): void { // Banking registerAccountTools(server, client); registerCardTools(server, client); registerCreditTools(server, client); - src/tools/_shared.ts:28-54 (helper)The defineTool helper wraps the handler and registers the tool 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>, 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, ); }