Skip to main content
Glama

DeFi Trading Agent MCP Server

by edkdev

get_gasless_chains

Identify blockchain networks that support gasless swaps to enable cost-efficient trading and transactions within the DeFi Trading Agent MCP Server.

Instructions

Get list of blockchain networks that support gasless swaps

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "required": [], "type": "object" }

Implementation Reference

  • Primary MCP tool handler for get_gasless_chains. Delegates to AgService and formats the response with message, data, summary, and note.
    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 implementation that performs HTTP fetch to the aggregator API endpoint /api/swap/gasless/chains and handles response/error.
    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}`); } }
  • src/index.js:1154-1156 (registration)
    MCP server switch case registration that routes tool calls to toolService.getGaslessChains()
    case TOOL_NAMES.GET_GASLESS_CHAINS: result = await toolService.getGaslessChains(); break;
  • Tool schema registration in MCP server listTools handler, defining name, description, and empty input schema.
    name: TOOL_NAMES.GET_GASLESS_CHAINS, description: "Get list of blockchain networks that support gasless swaps", inputSchema: { type: "object", properties: {}, required: [], }, },
  • Constant definition for the tool name used across 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