Skip to main content
Glama

list_payments

List recent payments from your CardZero wallet with optional pagination controls.

Instructions

View recent payment history for your CardZero wallet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of records to return (default: 20)
offsetNoNumber of records to skip for pagination (default: 0)

Implementation Reference

  • src/index.ts:158-181 (registration)
    Registration of the 'list_payments' tool via server.tool(), including tool name and description.
    // Tool 4: List Payments
    server.tool(
      "list_payments",
      "View recent payment history for your CardZero wallet.",
      {
        limit: z.number().optional().describe("Number of records to return (default: 20)"),
        offset: z.number().optional().describe("Number of records to skip for pagination (default: 0)"),
      },
      async ({ limit, offset }) => {
        try {
          const missing = requireWalletId();
          if (missing) return errorResponse("List payments failed", missing);
          const params = new URLSearchParams();
          if (limit !== undefined) params.set("limit", String(limit));
          if (offset !== undefined) params.set("offset", String(offset));
          const query = params.toString() ? `?${params.toString()}` : "";
          const res = await callApi("GET", `/wallets/${WALLET_ID}/payments${query}`);
          if (!res.ok) return errorResponse("List payments failed", res);
          return successResponse(res.json);
        } catch (e) {
          return { content: [{ type: "text" as const, text: `List payments error: ${e}` }], isError: true };
        }
      },
    );
  • Input schema for list_payments: optional limit (number) and offset (number) with Zod validators and descriptions.
    {
      limit: z.number().optional().describe("Number of records to return (default: 20)"),
      offset: z.number().optional().describe("Number of records to skip for pagination (default: 0)"),
    },
  • Handler function for list_payments: validates wallet ID, builds query params, calls GET /wallets/{id}/payments API, and returns paginated payment history.
    async ({ limit, offset }) => {
      try {
        const missing = requireWalletId();
        if (missing) return errorResponse("List payments failed", missing);
        const params = new URLSearchParams();
        if (limit !== undefined) params.set("limit", String(limit));
        if (offset !== undefined) params.set("offset", String(offset));
        const query = params.toString() ? `?${params.toString()}` : "";
        const res = await callApi("GET", `/wallets/${WALLET_ID}/payments${query}`);
        if (!res.ok) return errorResponse("List payments failed", res);
        return successResponse(res.json);
      } catch (e) {
        return { content: [{ type: "text" as const, text: `List payments error: ${e}` }], isError: true };
      }
    },
  • requireWalletId helper: validates that WALLET_ID is set, returns null on success or an ApiResult error object on failure.
    function requireWalletId(): ApiResult | null {
      if (WALLET_ID) return null;
      return {
        ok: false,
        status: 401,
        json: {
          error: "config_missing",
          message: "CARDZERO_WALLET_ID is not set. Get one at https://cardzero.ai",
        },
      };
    }
  • successResponse helper: formats the API response as a text content block for MCP.
    function successResponse(data: unknown) {
      return {
        content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
      };
    }
Behavior2/5

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

No annotations provided, so description carries full burden. It only says 'View recent payment history' but doesn't disclose that it returns a list, ordering, or side effects. Minimal behavioral context.

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?

Single sentence, no extraneous information. Efficient and front-loaded.

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

Completeness2/5

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

No output schema, and description does not explain what the response contains (e.g., list of payment objects). For a simple listing tool, more detail on return format or default behavior would be helpful.

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 coverage is 100% for parameters (limit and offset). Description adds no value beyond the schema; baseline of 3 is appropriate.

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?

The description clearly states it lists payment history for the wallet, using a specific verb and resource. It distinguishes from siblings like get_payment (single) and send_payment (send).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool vs alternatives like get_payment for a specific payment or send_payment for sending. No mention of pagination or filtering implications.

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/mrocker/cardzero-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server