get_x402_payee_address
Retrieve the receiving address for on-chain x402 payments to use in payment requirements before Mode B Refill. Specify chain and token codes like BASE/USDC or ETH/USDC.
Instructions
Get the system receiving address for x402 on-chain payments.
When to use: MUST call this before Mode B Refill to obtain payee_address for payment_requirements.payTo. Not needed for Mode B card creation — the 402 quote response already includes payee_address.
Common chain + token combinations: BASE + USDC, ETH + USDC. If this returns 404: the payee address for this chain/token is not initialized — try a different chain or contact support.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain_code | Yes | Chain code, e.g. 'ETH', 'BASE' | |
| token_code | Yes | Token code, e.g. 'USDC' |
Implementation Reference
- src/tools/wallet.ts:76-97 (handler)The handler function for get_x402_payee_address which calls the /payment/x402/payee-address API endpoint.
async ({ chain_code, token_code }) => { try { const result = await client.get<X402PayeeAddress>("/payment/x402/payee-address", { chain_code, token_code, }); return toolOk(result); } catch (err) { if (err instanceof ClawallexApiError && err.statusCode === 404) { return { content: [{ type: "text" as const, text: `No payee address found for ${chain_code} + ${token_code}. ` + "The payee address for this chain/token combination has not been initialized. " + "Common combinations: ETH + USDC. " + "Contact support to enable this chain." }], isError: true as const, }; } return toolError(err); } }, - src/tools/wallet.ts:72-75 (registration)Input schema for get_x402_payee_address.
{ chain_code: z.string().describe("Chain code, e.g. 'ETH', 'BASE'"), token_code: z.string().describe("Token code, e.g. 'USDC'"), }, - src/tools/wallet.ts:61-98 (registration)Registration of the get_x402_payee_address tool within the MCP server.
server.tool( "get_x402_payee_address", [ "Get the system receiving address for x402 on-chain payments.", "", "When to use: MUST call this before Mode B Refill to obtain payee_address for payment_requirements.payTo.", "Not needed for Mode B card creation — the 402 quote response already includes payee_address.", "", "Common chain + token combinations: BASE + USDC, ETH + USDC.", "If this returns 404: the payee address for this chain/token is not initialized — try a different chain or contact support.", ].join("\n"), { chain_code: z.string().describe("Chain code, e.g. 'ETH', 'BASE'"), token_code: z.string().describe("Token code, e.g. 'USDC'"), }, async ({ chain_code, token_code }) => { try { const result = await client.get<X402PayeeAddress>("/payment/x402/payee-address", { chain_code, token_code, }); return toolOk(result); } catch (err) { if (err instanceof ClawallexApiError && err.statusCode === 404) { return { content: [{ type: "text" as const, text: `No payee address found for ${chain_code} + ${token_code}. ` + "The payee address for this chain/token combination has not been initialized. " + "Common combinations: ETH + USDC. " + "Contact support to enable this chain." }], isError: true as const, }; } return toolError(err); } }, );