Skip to main content
Glama
edkdev

DeFi Trading Agent MCP Server

by edkdev

get_gasless_chains

Find blockchain networks that support gasless swaps to enable trading without paying transaction fees.

Instructions

Get list of blockchain networks that support gasless swaps

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Primary handler function for the 'get_gasless_chains' tool. Delegates to AgService and formats the response for MCP protocol.
    async getGaslessChains() { const result = await this.agg.getGaslessChains(); return { message: "Gasless supported chains retrieved successfully", data: result, summary: `Found ${ result.chains?.length || 0 } chains supporting gasless swaps`, note: "These chains support meta-transaction based gasless swaps", }; }
  • Core utility function in AgService that performs the HTTP request to retrieve gasless-supported chains from the aggregator backend.
    async getGaslessChains() { try { const response = await fetch(`${this.baseUrl}/api/swap/gasless/chains`); 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 chains request failed'); } return data.data; } catch (error) { throw new Error(`Failed to get gasless chains: ${error.message}`); } }
  • Tool schema definition including name, description, and empty input schema (no parameters required).
    { name: TOOL_NAMES.GET_GASLESS_CHAINS, description: "Get list of blockchain networks that support gasless swaps", inputSchema: { type: "object", properties: {}, required: [], }, },
  • src/index.js:1154-1156 (registration)
    Registration in the tool dispatch switch statement that routes calls to ToolService.getGaslessChains()
    case TOOL_NAMES.GET_GASLESS_CHAINS: result = await toolService.getGaslessChains(); break;
  • Constant definition for the tool name used throughout the codebase.
    GET_GASLESS_CHAINS: "get_gasless_chains",

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