Skip to main content
Glama

get_token_address

Retrieve the Aptos Mainnet address for supported tokens (USDC, USDT, WBTC, USDe, USD1) to enable gasless transaction integration using the SmoothSend SDK.

Instructions

Get the Aptos Mainnet fungible asset address for a supported token (USDC, USDT, WBTC, USDe, USD1). Required when using ScriptComposerClient.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesThe token symbol to look up.

Implementation Reference

  • Handler function that retrieves token address and decimals from the TOKENS lookup table, validates the symbol, and returns formatted information with usage example for ScriptComposerClient.
    export function handleGetTokenAddress(args: { symbol: string }): string {
      const token = TOKENS[args.symbol]
      if (!token) {
        return `Unknown token "${args.symbol}". Supported tokens: ${Object.keys(TOKENS).join(', ')}`
      }
    
      return [
        `## ${args.symbol} on Aptos Mainnet`,
        ``,
        `**Asset Address:**`,
        `\`${token.address}\``,
        ``,
        `**Decimals:** ${token.decimals}`,
        ``,
        `**Usage in ScriptComposerClient:**`,
        `\`\`\`typescript`,
        `const build = await client.buildTransfer({`,
        `  sender: walletAddress,`,
        `  recipient: '0xRecipient',`,
        `  amount: '1${'0'.repeat(token.decimals)}', // 1 ${args.symbol} (${token.decimals} decimals)`,
        `  assetType: '${token.address}',`,
        `  decimals: ${token.decimals},`,
        `  symbol: '${args.symbol}',`,
        `});`,
        `\`\`\``,
      ].join('\n')
    }
  • Tool definition with name, description, and JSON Schema input validation specifying the symbol parameter must be one of the supported tokens (USDC, USDT, WBTC, USDe, USD1).
    {
      name: 'get_token_address',
      description:
        'Get the Aptos Mainnet fungible asset address for a supported token (USDC, USDT, WBTC, USDe, USD1). Required when using ScriptComposerClient.',
      inputSchema: {
        type: 'object' as const,
        properties: {
          symbol: {
            type: 'string',
            enum: ['USDC', 'USDT', 'WBTC', 'USDe', 'USD1'],
            description: 'The token symbol to look up.',
          },
        },
        required: ['symbol'],
      },
    },
  • src/index.ts:60-62 (registration)
    Tool routing in the CallToolRequestSchema handler that maps 'get_token_address' tool calls to the handleGetTokenAddress function.
    case 'get_token_address':
      text = handleGetTokenAddress(args as { symbol: string })
      break
  • Data store containing token metadata (decimals and on-chain addresses) for USDC, USDT, WBTC, USDe, and USD1 on Aptos Mainnet, used by the handler for lookups.
    // Token addresses on Aptos Mainnet
    const TOKENS: Record<string, { decimals: number; address: string }> = {
      USDC: {
        decimals: 6,
        address: '0xbae207659db88bea0cbead6da0ed00aac12edcdda169e591cd41c94180b46f3b',
      },
      USDT: {
        decimals: 6,
        address: '0x357b0b74bc833e95a115ad22604854d6b0fca151cecd94111770e5d6ffc9dc2b',
      },
      WBTC: {
        decimals: 8,
        address: '0x68c2185f5e2023f2e4401ba56b66c8ae2cfcf8a27852e70eb78b03f59a652a3d',
      },
      USDe: {
        decimals: 6,
        address: '0xf37a4a75f89b79985c1fcb42d0a87f4bde28cc2b46c4dd01d9a8428e7726e2e9',
      },
      USD1: {
        decimals: 6,
        address: '0x05fa02d0fa44a90ad59fb90adb08e24c4efbc98eb9e9f2d0d9c0ad18d7fc9d2',
      },
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes the tool's purpose and context but lacks details on behavioral traits such as rate limits, error handling, or response format. The description does not contradict any annotations, but it could be more informative about operational aspects.

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?

The description is appropriately sized and front-loaded, consisting of two concise sentences that directly state the tool's purpose and usage context without any wasted words. Every sentence earns its place by providing essential information efficiently.

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

Completeness4/5

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

Given the tool's low complexity (single parameter with enum) and no output schema, the description is reasonably complete. It covers the purpose, supported tokens, and usage context. However, it could be more complete by including information about the return value or error cases, which would help an agent understand what to expect from the tool's execution.

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, with a well-documented 'symbol' parameter including an enum. The description adds value by specifying the supported tokens (USDC, USDT, WBTC, USDe, USD1), which aligns with the enum, but does not provide additional semantic details beyond what the schema already covers. This meets the baseline for high schema coverage.

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 clearly states the specific action ('Get'), resource ('Aptos Mainnet fungible asset address'), and scope ('for a supported token'). It distinguishes this tool from siblings by specifying its unique function of retrieving token addresses, unlike estimate_credits, get_code_snippet, or get_docs which serve different purposes.

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?

The description provides clear context for when to use this tool ('Required when using ScriptComposerClient'), indicating its dependency or prerequisite scenario. However, it does not explicitly state when not to use it or name alternatives for similar functions, which prevents a perfect score.

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

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