Skip to main content
Glama
edkdev

DeFi Trading Agent MCP Server

by edkdev

get_gasless_status

Check the status of a submitted gasless swap transaction by providing the trade hash and blockchain ID to monitor execution progress.

Instructions

Get the status of a submitted gasless swap

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tradeHashYesTrade hash from gasless swap submission
chainIdYesBlockchain ID where the trade was submitted

Implementation Reference

  • Main handler function for the get_gasless_status tool. Validates input parameters (tradeHash, chainId), calls the AgService to fetch status, and formats the response with additional metadata for the MCP protocol.
    async getGaslessStatus(params) {
      const { tradeHash, chainId } = params;
    
      if (!tradeHash || !chainId) {
        throw new Error("Missing required parameters: tradeHash, chainId");
      }
    
      const result = await this.agg.getGaslessStatus(tradeHash, chainId);
    
      return {
        message: `Gasless swap status for ${tradeHash} retrieved successfully`,
        data: result,
        summary: `Status: ${result.status || "unknown"}`,
        gaslessInfo: {
          tradeHash,
          chainId,
          isGasless: true,
          relayerManaged: true,
        },
      };
    }
  • Input schema and description for the get_gasless_status tool, registered in the ListToolsRequestHandler response.
      name: TOOL_NAMES.GET_GASLESS_STATUS,
      description: "Get the status of a submitted gasless swap",
      inputSchema: {
        type: "object",
        properties: {
          tradeHash: {
            type: "string",
            description: "Trade hash from gasless swap submission",
          },
          chainId: {
            type: "integer",
            description: "Blockchain ID where the trade was submitted",
          },
        },
        required: ["tradeHash", "chainId"],
      },
    },
  • src/index.js:1150-1152 (registration)
    Dispatch/registration in the CallToolRequestHandler switch statement that routes calls to toolService.getGaslessStatus.
    case TOOL_NAMES.GET_GASLESS_STATUS:
      result = await toolService.getGaslessStatus(args);
      break;
  • Core helper function in AgService that makes the HTTP request to the aggregator API endpoint /api/swap/gasless/status/{tradeHash} to retrieve the actual status data.
    async getGaslessStatus(tradeHash, chainId) {
      try {
        const response = await fetch(`${this.baseUrl}/api/swap/gasless/status/${tradeHash}?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 status request failed');
        }
        
        return data.data;
      } catch (error) {
        throw new Error(`Failed to get gasless status: ${error.message}`);
      }
    }
  • Constant definition for the tool name used throughout the codebase.
    GET_GASLESS_STATUS: "get_gasless_status",
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it retrieves status without disclosing behavioral traits. It doesn't mention whether this is a read-only operation, what the status response includes, potential errors, rate limits, or authentication requirements for a gasless swap system.

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, focused sentence with zero wasted words. It's front-loaded with the core purpose and efficiently communicates the essential function without unnecessary elaboration.

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

Completeness2/5

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

For a status-checking tool with no annotations and no output schema, the description is insufficient. It doesn't explain what status information is returned, possible status values, or how to interpret results. Given the complexity of gasless swaps and lack of structured output documentation, more context is needed.

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%, providing clear parameter documentation. The description adds no additional parameter semantics beyond what's in the schema, but since the schema fully describes both required parameters, this meets the baseline expectation for high coverage.

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 the status') and resource ('submitted gasless swap'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'submit_gasless_swap' beyond the obvious status vs. submission distinction, missing opportunities to clarify scope boundaries.

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?

No guidance is provided about when to use this tool versus alternatives. While the name implies it's for checking status after submission, there's no explicit mention of prerequisites (e.g., must have a tradeHash from 'submit_gasless_swap') or when other tools might be more appropriate.

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