Skip to main content
Glama
recallnet

Trading Simulator MCP Server

by recallnet

get_quote

Retrieve trading quotes for token swaps across EVM and SVM blockchains. Specify source and destination tokens with amounts to get potential trade prices.

Instructions

Get a quote for a potential trade

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromTokenYesSource token address
toTokenYesDestination token address
amountYesAmount of fromToken to potentially trade
fromChainNoOptional blockchain type for source token
toChainNoOptional blockchain type for destination token
fromSpecificChainNoOptional specific chain for source token
toSpecificChainNoOptional specific chain for destination token

Implementation Reference

  • MCP tool handler for 'get_quote': validates input arguments, extracts parameters, calls tradingClient.getQuote, and returns the JSON-formatted response.
    case "get_quote": {
      if (!args || typeof args !== "object" || 
          !("fromToken" in args) || !("toToken" in args) || !("amount" in args)) {
        throw new Error("Invalid arguments for get_quote");
      }
      
      const fromToken = args.fromToken as string;
      const toToken = args.toToken as string;
      const amount = args.amount as string;
      const fromChain = "fromChain" in args ? args.fromChain as BlockchainType : undefined;
      const toChain = "toChain" in args ? args.toChain as BlockchainType : undefined;
      const fromSpecificChain = "fromSpecificChain" in args ? args.fromSpecificChain as SpecificChain : undefined;
      const toSpecificChain = "toSpecificChain" in args ? args.toSpecificChain as SpecificChain : undefined;
      
      const response = await tradingClient.getQuote(
        fromToken, 
        toToken, 
        amount, 
        fromChain, 
        toChain, 
        fromSpecificChain, 
        toSpecificChain
      );
      
      return {
        content: [{ type: "text", text: JSON.stringify(response, null, 2) }],
        isError: false
      };
    }
  • Tool schema definition for 'get_quote' including input schema with required fields fromToken, toToken, amount and optional chain parameters.
    {
      name: "get_quote",
      description: "Get a quote for a potential trade",
      inputSchema: {
        type: "object",
        properties: {
          fromToken: {
            type: "string",
            description: "Source token address"
          },
          toToken: {
            type: "string",
            description: "Destination token address"
          },
          amount: {
            type: "string",
            description: "Amount of fromToken to potentially trade"
          },
          fromChain: {
            type: "string",
            enum: ["svm", "evm"],
            description: "Optional blockchain type for source token"
          },
          toChain: {
            type: "string",
            enum: ["svm", "evm"],
            description: "Optional blockchain type for destination token"
          },
          fromSpecificChain: {
            type: "string",
            enum: ["eth", "polygon", "bsc", "arbitrum", "base", "optimism", "avalanche", "linea", "svm"],
            description: "Optional specific chain for source token"
          },
          toSpecificChain: {
            type: "string",
            enum: ["eth", "polygon", "bsc", "arbitrum", "base", "optimism", "avalanche", "linea", "svm"],
            description: "Optional specific chain for destination token"
          }
        },
        required: ["fromToken", "toToken", "amount"],
        additionalProperties: false,
        $schema: "http://json-schema.org/draft-07/schema#"
      }
    },
  • src/index.ts:411-415 (registration)
    Registers the list of tools including 'get_quote' via the ListToolsRequestHandler.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: TRADING_SIM_TOOLS
      };
    });
  • Helper method in TradingSimulatorClient that makes the actual API request to /api/trade/quote with query parameters and handles response or error.
    async getQuote(
      fromToken: string,
      toToken: string,
      amount: string,
      fromChain?: BlockchainType,
      toChain?: BlockchainType,
      fromSpecificChain?: SpecificChain,
      toSpecificChain?: SpecificChain
    ): Promise<QuoteResponse | ErrorResponse> {
      const params = new URLSearchParams();
      params.append('fromToken', fromToken);
      params.append('toToken', toToken);
      params.append('amount', amount);
      
      if (fromChain) {
        params.append('fromChain', fromChain);
      }
      
      if (toChain) {
        params.append('toChain', toChain);
      }
      
      if (fromSpecificChain) {
        params.append('fromSpecificChain', fromSpecificChain);
      }
      
      if (toSpecificChain) {
        params.append('toSpecificChain', toSpecificChain);
      }
      
      return this.request<QuoteResponse>(
        'GET',
        `/api/trade/quote?${params.toString()}`,
        null,
        'get quote'
      );
    }
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 this gets a quote for a 'potential' trade, implying it's a read-only estimation, but doesn't specify if it's a simulation, whether it requires authentication, has rate limits, or what the output format might be. This leaves significant gaps for a tool with 7 parameters.

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 with no wasted words. It's appropriately sized for a tool with a straightforward purpose, though it could benefit from additional context.

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?

Given the complexity (7 parameters, no annotations, no output schema), the description is insufficient. It doesn't explain what a 'quote' entails (e.g., exchange rate, fees, slippage), how results are returned, or error conditions. For a financial tool with multiple parameters, this leaves too much undefined.

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?

The description adds no parameter-specific information beyond what's already in the schema (which has 100% coverage). It doesn't explain relationships between parameters (e.g., how 'fromChain' interacts with 'fromSpecificChain') or provide usage examples. With high schema coverage, the baseline is 3, but no extra value is added.

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 a quote') and the resource ('for a potential trade'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'get_price' or 'execute_trade' that might also relate to trading operations, which prevents a perfect score.

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 that this is for pre-trade estimation (vs. 'execute_trade' for actual execution) or how it differs from price-related tools like 'get_price'. There's no context about prerequisites or exclusions.

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/recallnet/trading-simulator-mcp'

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