Skip to main content
Glama
edkdev

DeFi Trading Agent MCP Server

by edkdev

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
NameRequiredDescriptionDefault
chainIdNoBlockchain ID (e.g., 8453 for Base, defaults to 8453 if not provided)

Implementation Reference

  • 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,
      };
    }
  • 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;
  • 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",
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe behavioral traits like whether this is a read-only operation (implied by 'Get list'), potential rate limits, authentication requirements, error conditions, or the format/structure of the returned list. For a tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves.

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 a single, efficient sentence that front-loads the core purpose ('Get list of tokens') and adds necessary qualification ('that support gasless approvals (EIP-2612 permit)'). Every word earns its place, with no redundancy or unnecessary elaboration, making it easy for an agent to parse quickly.

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

Completeness3/5

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

Given the tool's moderate complexity (fetching a filtered list), no annotations, no output schema, and 100% schema coverage, the description is minimally adequate. It clearly states the purpose but lacks behavioral context (e.g., response format, pagination) and usage guidelines. The absence of an output schema means the description should ideally hint at return values, but it doesn't, leaving the agent to discover this through 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?

Schema description coverage is 100%, with the single parameter 'chainId' fully documented in the schema (including its type, description, and default value). The description adds no parameter-specific information beyond what's in the schema, so it meets the baseline of 3 for high schema coverage. It doesn't compensate for any gaps because there are none in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get list of tokens') and the specific resource type ('tokens that support gasless approvals (EIP-2612 permit)'). It distinguishes this tool from siblings like get_token_data or get_token_info by focusing on gasless approval support rather than general token information. However, it doesn't explicitly contrast with get_gasless_chains or get_gasless_status, which are related but different gasless tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a chainId for context), compare it to similar tools like get_gasless_chains (which lists chains supporting gasless features) or get_token_data (which provides general token info), or specify use cases (e.g., before executing a gasless swap). The agent must infer usage from the tool name and description alone.

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

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