Skip to main content
Glama

DeFi Trading Agent MCP Server

by edkdev

get_gasless_approval_tokens

Retrieve tokens supporting gasless approvals via EIP-2612 permit for efficient DeFi transactions. Specify blockchain ID to filter results and streamline trading operations.

Instructions

Get list of tokens that support gasless approvals (EIP-2612 permit)

Input Schema

NameRequiredDescriptionDefault
chainIdNoBlockchain ID (e.g., 8453 for Base, defaults to 8453 if not provided)

Input Schema (JSON Schema)

{ "properties": { "chainId": { "description": "Blockchain ID (e.g., 8453 for Base, defaults to 8453 if not provided)", "type": "integer" } }, "required": [], "type": "object" }

Implementation Reference

  • Main handler function for the get_gasless_approval_tokens tool. Validates params, defaults chainId to Base (8453), calls AgService, and formats response.
    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, }; }
  • MCP tool schema definition including name, description, and input schema (optional chainId).
    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 main switch case handler for CallToolRequest.
    case TOOL_NAMES.GET_GASLESS_APPROVAL_TOKENS: result = await toolService.getGaslessApprovalTokens(args); break;
  • Core API call implementation in AgService that fetches approval tokens from the aggregator API endpoint.
    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)
    Tool name constant definition used in registration and dispatch.
    GET_GASLESS_APPROVAL_TOKENS: "get_gasless_approval_tokens",

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/edkdev/defi-trading-mcp'

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