Skip to main content
Glama

azeth_deposit

Deposit ETH or ERC-20 tokens from your external wallet into your Azeth smart account to fund transfers, payments, and operations.

Instructions

Deposit ETH or ERC-20 tokens from your EOA wallet into your own Azeth smart account.

Use this when: Your smart account needs funding for transfers, x402 payments, or other operations.

SECURITY: This verifies ON-CHAIN that the target is a real Azeth smart account owned by you. You cannot deposit to someone else's smart account.

Returns: Transaction hash and deposit details.

Note: If no target account is specified, deposits to your first smart account. For ETH deposits, omit the token parameter. For ERC-20 tokens, provide the token contract address AND decimals. The amount is in human-readable units (e.g., "0.01" for 0.01 ETH, "100" for 100 USDC).

Example: { "amount": "0.01" } or { "amount": "50", "token": "0x036CbD53842c5426634e7929541eC2318f3dCF7e", "decimals": 6 }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainNoTarget chain. Defaults to AZETH_CHAIN env var or "baseSepolia". Accepts "base", "baseSepolia", "ethereumSepolia", "ethereum" (and aliases like "base-sepolia", "eth-sepolia", "sepolia", "eth", "mainnet").
amountYesAmount to deposit in human-readable units (e.g., "0.01" for 0.01 ETH).
tokenNoERC-20 token contract address. Omit for native ETH deposit.
decimalsNoToken decimals for ERC-20 deposits. REQUIRED when token is specified. Use 6 for USDC, 18 for WETH.
smartAccountNoTarget smart account address, name, or "#N" (account index). If omitted, deposits to your first Azeth account.

Implementation Reference

  • The implementation of the azeth_deposit MCP tool, which enables depositing ETH or ERC-20 tokens into a smart account.
    // azeth_deposit
    // ──────────────────────────────────────────────
    server.registerTool(
      'azeth_deposit',
      {
        description: [
          'Deposit ETH or ERC-20 tokens from your EOA wallet into your own Azeth smart account.',
          '',
          'Use this when: Your smart account needs funding for transfers, x402 payments, or other operations.',
          '',
          'SECURITY: This verifies ON-CHAIN that the target is a real Azeth smart account owned by you.',
          'You cannot deposit to someone else\'s smart account.',
          '',
          'Returns: Transaction hash and deposit details.',
          '',
          'Note: If no target account is specified, deposits to your first smart account.',
          'For ETH deposits, omit the token parameter. For ERC-20 tokens, provide the token contract address AND decimals.',
          'The amount is in human-readable units (e.g., "0.01" for 0.01 ETH, "100" for 100 USDC).',
          '',
          'Example: { "amount": "0.01" } or { "amount": "50", "token": "0x036CbD53842c5426634e7929541eC2318f3dCF7e", "decimals": 6 }',
        ].join('\n'),
        inputSchema: z.object({
          chain: z.string().optional().describe('Target chain. Defaults to AZETH_CHAIN env var or "baseSepolia". Accepts "base", "baseSepolia", "ethereumSepolia", "ethereum" (and aliases like "base-sepolia", "eth-sepolia", "sepolia", "eth", "mainnet").'),
          amount: z.string().describe('Amount to deposit in human-readable units (e.g., "0.01" for 0.01 ETH).'),
          token: z.string().optional().describe('ERC-20 token contract address. Omit for native ETH deposit.'),
          decimals: z.coerce.number().int().min(0).max(18).optional()
            .describe('Token decimals for ERC-20 deposits. REQUIRED when token is specified. Use 6 for USDC, 18 for WETH.'),
          smartAccount: z.string().optional()
            .describe('Target smart account address, name, or "#N" (account index). If omitted, deposits to your first Azeth account.'),
        }),
      },
      async (args) => {
        if (args.token && !validateAddress(args.token)) {
          return error('INVALID_INPUT', `Invalid token address: "${args.token}".`, 'Must be 0x-prefixed followed by 40 hex characters.');
        }
        if (args.token && args.decimals === undefined) {
          return error('INVALID_INPUT', 'decimals is required when token address is provided.', 'Use 6 for USDC, 18 for WETH.');
        }
    
        let client;
        try {
          client = await createClient(args.chain);
    
          let target: `0x${string}`;
          if (args.smartAccount) {
            try {
              target = (await resolveSmartAccount(args.smartAccount, client))!;
            } catch (resolveErr) {
              return handleError(resolveErr);
            }
          } else {
            target = await client.resolveSmartAccount();
          }
    
          const decimals = args.decimals ?? 18;
          let amount: bigint;
          try {
            amount = args.token ? parseUnits(args.amount, decimals) : parseEther(args.amount);
          } catch {
            return error('INVALID_INPUT', 'Invalid amount format — must be a valid decimal number.');
          }
    
          const result = await client.deposit({
            to: target,
            amount,
            token: args.token as `0x${string}` | undefined,
          });
    
          return success(
            {
              txHash: result.txHash,
              from: result.from,
              to: result.to,
              amount: args.amount,
              token: result.token,
            },
            { txHash: result.txHash },
          );
        } catch (err) {
          return handleError(err);
        } finally {
          try { await client?.destroy(); } catch (e) { process.stderr.write(`[azeth-mcp] destroy error: ${e instanceof Error ? e.message : String(e)}\n`); }
        }
      },
    );

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/azeth-protocol/mcp-azeth'

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