Skip to main content
Glama

azeth_whitelist_token

Manage token whitelist for smart account automated operations. Add or remove tokens to enable payment agreements and executor-module transactions.

Instructions

Add or remove a token from your smart account's guardian whitelist.

Use this when: You need to whitelist a new token for payment agreements or other executor-module operations. Newly created accounts already have ETH, USDC, and WETH whitelisted by default.

Why it matters: The GuardianModule enforces a token whitelist for automated operations (payment agreements, swap execution). Owner-signed transfers bypass the whitelist, but executor modules like PaymentAgreementModule require the token to be whitelisted.

Returns: Transaction hash confirming the whitelist update.

Note: Only the account owner can update their own whitelist.

Example: { "token": "0x036CbD53842c5426634e7929541eC2318f3dCF7e", "allowed": true }

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").
tokenYesToken contract address to whitelist/delist. Use "0x0000000000000000000000000000000000000000" for native ETH.
allowedYestrue to whitelist the token, false to remove it from the whitelist.
smartAccountNoSmart account address, name, or "#N". Defaults to first smart account.

Implementation Reference

  • The handler function for 'azeth_whitelist_token' which resolves the smart account, validates the token, and calls client.setTokenWhitelist to update the whitelist status.
    async (args) => {
      if (!validateAddress(args.token)) {
        return error('INVALID_INPUT', `Invalid token address: "${args.token}".`, 'Must be 0x-prefixed followed by 40 hex characters.');
      }
    
      let client;
      try {
        client = await createClient(args.chain);
    
        let account: `0x${string}`;
        if (args.smartAccount) {
          try {
            account = (await resolveSmartAccount(args.smartAccount, client))!;
          } catch (resolveErr) {
            return handleError(resolveErr);
          }
        } else {
          account = await client.resolveSmartAccount();
        }
    
        const txHash = await client.setTokenWhitelist(
          args.token as `0x${string}`,
          args.allowed,
          account,
        );
    
        const action = args.allowed ? 'whitelisted' : 'removed from whitelist';
        // Resolve token symbol for display
        const chain = resolveChain(args.chain);
        const tokens = TOKENS[chain];
        const tokenLower = args.token.toLowerCase();
        let tokenSymbol = args.token.slice(0, 6) + '...' + args.token.slice(-4);
        if (args.token === '0x0000000000000000000000000000000000000000') tokenSymbol = 'ETH';
        else if (tokenLower === tokens.USDC.toLowerCase()) tokenSymbol = 'USDC';
        else if (tokenLower === tokens.WETH.toLowerCase()) tokenSymbol = 'WETH';
    
        return success(
          {
            token: args.token,
            tokenSymbol,
            allowed: args.allowed,
            message: `${tokenSymbol} (${args.token}) ${action} on account ${account}.`,
          },
          { txHash },
        );
      } catch (err) {
        // Detect AA24 signature validation failure — common for guardian-gated operations
        if (err instanceof Error && /AA24/.test(err.message)) {
          return guardianRequiredError(
  • The input schema definition for 'azeth_whitelist_token' using Zod.
    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").'),
      token: z.string().describe('Token contract address to whitelist/delist. Use "0x0000000000000000000000000000000000000000" for native ETH.'),
      allowed: z.boolean().describe('true to whitelist the token, false to remove it from the whitelist.'),
      smartAccount: z.string().optional().describe('Smart account address, name, or "#N". Defaults to first smart account.'),
    }),
  • The registration of the 'azeth_whitelist_token' tool using the server.registerTool method.
    server.registerTool(
      'azeth_whitelist_token',
      {
        description: [
          'Add or remove a token from your smart account\'s guardian whitelist.',
          '',
          'Use this when: You need to whitelist a new token for payment agreements or other executor-module operations.',
          'Newly created accounts already have ETH, USDC, and WETH whitelisted by default.',
          '',
          'Why it matters: The GuardianModule enforces a token whitelist for automated operations',
          '(payment agreements, swap execution). Owner-signed transfers bypass the whitelist,',
          'but executor modules like PaymentAgreementModule require the token to be whitelisted.',
          '',
          'Returns: Transaction hash confirming the whitelist update.',
          '',
          'Note: Only the account owner can update their own whitelist.',
          '',
          'Example: { "token": "0x036CbD53842c5426634e7929541eC2318f3dCF7e", "allowed": true }',
        ].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").'),
          token: z.string().describe('Token contract address to whitelist/delist. Use "0x0000000000000000000000000000000000000000" for native ETH.'),
          allowed: z.boolean().describe('true to whitelist the token, false to remove it from the whitelist.'),
          smartAccount: z.string().optional().describe('Smart account address, name, or "#N". Defaults to first smart account.'),
        }),
      },
Behavior5/5

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

Excellent disclosure given no annotations: explains GuardianModule enforcement mechanism, distinguishes between owner-signed transfers (bypass whitelist) vs executor modules (require whitelist), states authorization requirements ('Only the account owner'), and specifies the return value ('Transaction hash'). Covers security implications comprehensively.

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?

Structured with clear semantic headers ('Use this when', 'Why it matters', 'Returns', 'Note', 'Example'). Every sentence earns its place—no fluff, appropriate detail for a security-critical operation. Length balances completeness with readability.

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?

Fully addresses a 4-parameter state-mutation tool with no output schema: explains security prerequisites (ownership), side effects (whitelist update affecting PaymentAgreementModule), return values, and provides invocation example. Sufficient for correct operation given the complexity of smart account guardian modules.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage (baseline 3), the description adds a concrete JSON example showing address format and boolean usage, plus reinforces the semantic meaning of 'allowed' (true=whitelist) in the opening sentence. The example adds practical invocation context beyond schema definitions.

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 action ('Add or remove') and target resource ('token from your smart account's guardian whitelist'), clearly distinguishing it from sibling tools like azeth_whitelist_protocol (which handles protocols rather than tokens) and azeth_transfer (which moves tokens rather than managing permissions).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit 'Use this when' guidance for payment agreements and executor-module operations. Explains default state (ETH/USDC/WETH pre-whitelisted) indicating when NOT to use it. However, it does not explicitly contrast with sibling azeth_whitelist_protocol for protocol-level whitelisting.

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

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