Skip to main content
Glama

get_tokens

Retrieve registered tokens for a specific blockchain network to enable token management and operations.

Instructions

Get registered tokens (builtin + custom) for a specific network.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkYesNetwork identifier (e.g., "ethereum-sepolia", "polygon-amoy" or CAIP-2 "eip155:1").

Implementation Reference

  • The registerGetTokens function implements the "get_tokens" tool, setting up the MCP tool registration, schema validation, and the handler function that queries the API.
    export function registerGetTokens(server: McpServer, apiClient: ApiClient, walletContext?: WalletContext): void {
      server.tool(
        'get_tokens',
        withWalletPrefix('Get registered tokens (builtin + custom) for a specific network.', walletContext?.walletName),
        {
          network: z.string().describe('Network identifier (e.g., "ethereum-sepolia", "polygon-amoy" or CAIP-2 "eip155:1").'),
        },
        async (args) => {
          const params = new URLSearchParams();
          params.set('network', args.network);
          const result = await apiClient.get('/v1/tokens?' + params.toString());
          return toToolResult(result);
        },
      );
    }

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/minhoyoo-iotrust/WAIaaS'

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