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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"required": [],
"type": "object"
}
Implementation Reference
- src/toolService.js:567-578 (handler)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", }; }
- src/services/agService.js:206-224 (handler)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;
- src/index.js:744-752 (schema)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: [], }, },
- src/constants.js:15-15 (helper)Constant definition for the tool name used across the codebase.GET_GASLESS_CHAINS: "get_gasless_chains",