get_gasless_approval_tokens
Retrieve tokens supporting gasless approvals via EIP-2612 permit to reduce transaction costs and streamline DeFi interactions on supported blockchains.
Instructions
Get list of tokens that support gasless approvals (EIP-2612 permit)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chainId | No | Blockchain ID (e.g., 8453 for Base, defaults to 8453 if not provided) |
Implementation Reference
- src/toolService.js:580-595 (handler)Main handler function for the 'get_gasless_approval_tokens' MCP tool. Extracts chainId (defaults to Base 8453), delegates to AgService, wraps response with metadata.async getGaslessApprovalTokens(params = {}) { // Default to Base chain if no chainId provided const chainId = params.chainId || 8453; const result = await this.agg.getGaslessApprovalTokens(chainId); return { message: "Gasless approval tokens retrieved successfully", data: result, summary: `Found ${ result.tokens?.length || 0 } tokens supporting gasless approvals on chain ${chainId}`, note: "These tokens support EIP-2612 permit or meta-transaction approvals", chainId, }; }
- src/index.js:754-767 (schema)MCP tool schema definition including inputSchema for 'get_gasless_approval_tokens' in the ListToolsRequestHandler.name: TOOL_NAMES.GET_GASLESS_APPROVAL_TOKENS, description: "Get list of tokens that support gasless approvals (EIP-2612 permit)", inputSchema: { type: "object", properties: { chainId: { type: "integer", description: "Blockchain ID (e.g., 8453 for Base, defaults to 8453 if not provided)", }, }, required: [], },
- src/index.js:1158-1160 (registration)Tool dispatch/registration in the CallToolRequestHandler switch statement, mapping tool name to handler.case TOOL_NAMES.GET_GASLESS_APPROVAL_TOKENS: result = await toolService.getGaslessApprovalTokens(args); break;
- src/services/agService.js:226-244 (helper)Helper service method in AgService that makes the actual API call to retrieve gasless approval tokens.async getGaslessApprovalTokens(chainId) { try { const response = await fetch(`${this.baseUrl}/api/swap/gasless/approval-tokens?chainId=${chainId}`); if (!response.ok) { throw new Error(`HTTP ${response.status}: ${response.statusText}`); } const data = await response.json(); if (!data.success) { throw new Error(data.error || 'Gasless approval tokens request failed'); } return data.data; } catch (error) { throw new Error(`Failed to get gasless approval tokens: ${error.message}`); } }
- src/constants.js:16-16 (registration)Constant definition for the tool name used throughout the codebase.GET_GASLESS_APPROVAL_TOKENS: "get_gasless_approval_tokens",