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
| Name | Required | Description | Default |
|---|---|---|---|
| network | Yes | Network 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); }, ); }