Skip to main content
Glama
klodr

mercury-invoicing-mcp

mercury_list_credit_accounts

Read-only

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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);
    },
  • Input schema: empty object ({}) since the tool takes no arguments.
    {},
  • 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 },
      );
  • 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);
  • 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,
      );
    }
Behavior5/5

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

Annotations already indicate readOnlyHint and openWorldHint; description adds endpoint (/credit), return shape, and notes it is a read operation. 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?

Concise and well-structured with sections for USE WHEN, DO NOT USE, RETURNS. Every sentence adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers purpose, usage, and return structure adequately. Lacks mention of pagination or limits, but for a zero-parameter list tool with openWorldHint, it is mostly complete.

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

Parameters4/5

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

No parameters, so baseline is 4. Description adds no parameter info, which is acceptable given the parameter count is zero.

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?

Description clearly states the tool lists Mercury IO Credit card accounts (charge cards), distinguishes from deposit accounts, and explicitly names the sibling tool for the other account type.

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 (enumerating accounts for balance, statement closing, feeding ID to mercury_list_credit_transactions) and DO NOT USE (deposit accounts, directs to mercury_list_accounts).

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