Skip to main content
Glama

Trading Simulator MCP Server

by recallnet

get_quote

Generate a trade quote by specifying source and destination tokens, amount, and optional blockchain details for accurate simulation and analysis.

Instructions

Get a quote for a potential trade

Input Schema

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

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "amount": { "description": "Amount of fromToken to potentially trade", "type": "string" }, "fromChain": { "description": "Optional blockchain type for source token", "enum": [ "svm", "evm" ], "type": "string" }, "fromSpecificChain": { "description": "Optional specific chain for source token", "enum": [ "eth", "polygon", "bsc", "arbitrum", "base", "optimism", "avalanche", "linea", "svm" ], "type": "string" }, "fromToken": { "description": "Source token address", "type": "string" }, "toChain": { "description": "Optional blockchain type for destination token", "enum": [ "svm", "evm" ], "type": "string" }, "toSpecificChain": { "description": "Optional specific chain for destination token", "enum": [ "eth", "polygon", "bsc", "arbitrum", "base", "optimism", "avalanche", "linea", "svm" ], "type": "string" }, "toToken": { "description": "Destination token address", "type": "string" } }, "required": [ "fromToken", "toToken", "amount" ], "type": "object" }

Implementation Reference

  • src/index.ts:305-348 (registration)
    Tool registration for 'get_quote' including name, description, and input schema definition.
    { 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#" } },
  • Handler implementation for the 'get_quote' tool within the CallToolRequestSchema switch statement. Validates input arguments and delegates execution to tradingClient.getQuote before formatting and returning the 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 }; }
  • TypeScript interface defining the expected output structure (QuoteResponse) for the get_quote tool response.
    export interface QuoteResponse extends ApiResponse { fromToken: string; toToken: string; fromAmount: number; toAmount: number; exchangeRate: number; slippage: number; prices: { fromToken: number; toToken: number; }; chains: { fromChain: BlockchainType; toChain: BlockchainType; }; fromSpecificChain?: string; toSpecificChain?: string; }

Other Tools

Related 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