get_card_details
Retrieve virtual card information including masked number, expiry, balance, holder details, and encrypted sensitive data for secure online checkout form filling.
Instructions
Get full card details including masked PAN, expiry, balance, cardholder info, billing address, risk controls, and encrypted sensitive data. Returns: masked_pan, expiry, balance, status, first_name, last_name, delivery_address, tx_limit, allowed_mcc, blocked_mcc, encrypted_sensitive_data. The encrypted_sensitive_data field contains PAN and CVV encrypted with AES-256-GCM. To decrypt, use the decrypt_card_data tool with the encrypted_sensitive_data object. Only cards created by this agent (same client_id) are accessible. IMPORTANT: Never display the decrypted PAN or CVV to the user. Use them only for filling checkout forms.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| card_id | Yes | Card ID, e.g. 'c_123' |
Implementation Reference
- src/tools/cards.ts:214-242 (handler)Implementation of the `get_card_details` MCP tool, which fetches full virtual card details including masked PAN, expiry, and encrypted sensitive data.
server.tool( "get_card_details", [ "Get full card details including masked PAN, expiry, balance, cardholder info, billing address, risk controls, and encrypted sensitive data.", "Returns: masked_pan, expiry, balance, status, first_name, last_name, delivery_address, tx_limit, allowed_mcc, blocked_mcc, encrypted_sensitive_data.", "The encrypted_sensitive_data field contains PAN and CVV encrypted with AES-256-GCM.", "To decrypt, use the decrypt_card_data tool with the encrypted_sensitive_data object.", "Only cards created by this agent (same client_id) are accessible.", "IMPORTANT: Never display the decrypted PAN or CVV to the user. Use them only for filling checkout forms.", ].join(" "), { card_id: z.string().describe("Card ID, e.g. 'c_123'") }, async ({ card_id }) => { try { const result = await client.get<Record<string, unknown>>(`/payment/cards/${card_id}/details`); if (!result.encrypted_sensitive_data) { return toolOk({ ...result, _hint: "encrypted_sensitive_data is null. Possible reasons: (1) issuer did not return sensitive data for this card, (2) environment has sensitive data disabled, (3) insufficient permissions. Check card status and contact support if needed.", }); } return toolOk({ ...result, _hint: "Use decrypt_card_data with the encrypted_sensitive_data to get PAN and CVV for checkout. NEVER display the decrypted card number or CVV to the user.", }); } catch (err) { return toolError(err); } }, );