list_cards
Retrieve virtual cards created by this agent to manage USDC-based payments, showing card details, balances, status, and refill modes for online transactions.
Instructions
List virtual cards created by this agent (scoped to the server's client_id). Cards created by other agents using the same API key are not visible. Returns: card_id, mode_code (100=Mode A, 200=Mode B), card_type (flash/stream), status, masked PAN, balance, and expiry. Tip: check mode_code to determine refill path — Mode A uses wallet balance, Mode B uses x402 on-chain.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number, starting from 1 (default 1) | |
| page_size | No | Results per page, max 100 (default 20) |
Implementation Reference
- src/tools/cards.ts:142-150 (handler)The handler function for the list_cards tool, which performs a GET request to /payment/cards.
async ({ page, page_size }) => { try { const query: Record<string, string | number> = {}; if (page !== undefined) query.page = page; if (page_size !== undefined) query.page_size = page_size; const result = await client.get<unknown>("/payment/cards", query); return toolOk(result); } catch (err) { return toolError(err); - src/tools/cards.ts:131-141 (schema)Input schema for the list_cards tool using Zod.
{ page: z.number().int().min(1).default(1).describe("Page number, starting from 1 (default 1)").optional(), page_size: z .number() .int() .min(1) .max(100) .default(20) .describe("Results per page, max 100 (default 20)") .optional(), }, - src/tools/cards.ts:123-130 (registration)Tool registration for list_cards on the server object.
server.tool( "list_cards", [ "List virtual cards created by this agent (scoped to the server's client_id).", "Cards created by other agents using the same API key are not visible.", "Returns: card_id, mode_code (100=Mode A, 200=Mode B), card_type (flash/stream), status, masked PAN, balance, and expiry.", "Tip: check mode_code to determine refill path — Mode A uses wallet balance, Mode B uses x402 on-chain.", ].join("\n"),