Skip to main content
Glama
clawallex

Clawallex MCP Server

by clawallex

get_wallet_recharge_addresses

Retrieve on-chain deposit addresses to add USDC funds to a wallet. Each address corresponds to a specific blockchain and token for secure wallet top-ups.

Instructions

Get the on-chain deposit addresses for a wallet. Send USDC to one of these addresses to top up the wallet balance. Each address is specific to a chain (e.g. BASE) and token (e.g. USDC). For Mode B (x402) card creation/refill, the system automatically selects the acquiring address — you do not need to call this manually.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wallet_idYesWallet ID returned by get_wallet, e.g. 'w_123'

Implementation Reference

  • The handler implementation for the 'get_wallet_recharge_addresses' tool.
    server.tool(
      "get_wallet_recharge_addresses",
      [
        "Get the on-chain deposit addresses for a wallet.",
        "Send USDC to one of these addresses to top up the wallet balance.",
        "Each address is specific to a chain (e.g. BASE) and token (e.g. USDC).",
        "For Mode B (x402) card creation/refill, the system automatically selects the acquiring address — you do not need to call this manually.",
      ].join(" "),
      { wallet_id: z.string().describe("Wallet ID returned by get_wallet, e.g. 'w_123'") },
      async ({ wallet_id }) => {
        try {
          const result = await client.get<RechargeAddressesResponse>(
            `/payment/wallets/${wallet_id}/recharge-addresses`,
          );
          if (result.data && result.data.length === 0) {
            return toolOk({
              ...result,
              _hint: "No recharge addresses found. Possible reasons: recharge address pool not enabled for this wallet, chain not activated, or test environment limitation. Contact support if this is unexpected.",
            });
          }
          return toolOk(result);
        } catch (err) {
          return toolError(err);
        }
      },
    );
  • Registration logic for the 'get_wallet_recharge_addresses' tool within 'registerWalletTools'.
    export function registerWalletTools(server: McpServer, client: ClawallexClient): void {
      server.tool(
        "get_wallet",
        [
          "Get the wallet details for the current API key.",
          "Each API key has exactly one wallet — shared across all agents using the same API key.",
          "Returns available_balance, frozen_balance, low_balance_threshold, currency (USD), and status.",
          "Use this to check if there is sufficient balance before creating cards (Mode A) or refilling (Mode A).",
        ].join(" "),
        {},
        async () => {
          try {
            const result = await client.get<WalletDetail>("/payment/wallets/detail");
            return toolOk(result);
          } catch (err) {
            return toolError(err);
          }
        },
      );
    
      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);
          }
        },
      );
    
      server.tool(
        "get_wallet_recharge_addresses",
        [
          "Get the on-chain deposit addresses for a wallet.",
          "Send USDC to one of these addresses to top up the wallet balance.",
          "Each address is specific to a chain (e.g. BASE) and token (e.g. USDC).",
          "For Mode B (x402) card creation/refill, the system automatically selects the acquiring address — you do not need to call this manually.",
        ].join(" "),
        { wallet_id: z.string().describe("Wallet ID returned by get_wallet, e.g. 'w_123'") },
        async ({ wallet_id }) => {
          try {
            const result = await client.get<RechargeAddressesResponse>(
              `/payment/wallets/${wallet_id}/recharge-addresses`,
            );
            if (result.data && result.data.length === 0) {
              return toolOk({
                ...result,
                _hint: "No recharge addresses found. Possible reasons: recharge address pool not enabled for this wallet, chain not activated, or test environment limitation. Contact support if this is unexpected.",
              });
            }
            return toolOk(result);
          } catch (err) {
            return toolError(err);
          }
        },
      );
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden. It successfully explains address scoping (chain/token specificity like BASE/USDC) and the auto-selection behavior for Mode B. However, it lacks details on address persistence (static vs. generated per call), error handling for invalid wallet_ids, or rate limiting.

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?

Four well-structured sentences: purpose (1), usage instruction (2), address characteristics (3), and exclusion guideline (4). Every sentence conveys unique information without redundancy, properly front-loading the core action.

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

Completeness5/5

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

For a single-parameter tool without output schema, the description is complete. It explains the return value concept (deposit addresses), the domain context (USDC, topping up), and differentiates from automatic workflows, providing sufficient context for correct invocation.

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?

The input schema has 100% description coverage (wallet_id is fully documented with type and example). The description adds no explicit parameter discussion, which is appropriate given the schema's completeness, meeting the baseline expectation for high-coverage schemas.

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 opens with a specific verb-resource pair ('Get the on-chain deposit addresses for a wallet') and distinguishes itself from siblings by explicitly referencing Mode B (x402) workflows, clarifying this tool is for manual deposit address retrieval rather than automatic card operations.

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?

Excellent guidance provided: it states when to use ('Send USDC to one of these addresses to top up the wallet balance') and explicitly when NOT to use ('For Mode B (x402) card creation/refill... you do not need to call this manually'), directly contrasting with sibling tools like get_x402_payee_address and clawallex_refill.

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/clawallex/clawallex-mcp'

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