Skip to main content
Glama
recallnet

Trading Simulator MCP Server

by recallnet

get_trades

Retrieve your team's trade history with filters for blockchain type, token address, and pagination to analyze past trading activity.

Instructions

Get trade history for your team

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of trades to retrieve (default: 20)
offsetNoOffset for pagination
tokenNoFilter by token address
chainNoFilter by blockchain type

Implementation Reference

  • src/index.ts:130-157 (registration)
    Registration of the 'get_trades' tool in the TRADING_SIM_TOOLS array, including name, description, and JSON input schema for parameters (limit, offset, token, chain).
    { name: "get_trades", description: "Get trade history for your team", inputSchema: { type: "object", properties: { limit: { type: "number", description: "Maximum number of trades to retrieve (default: 20)" }, offset: { type: "number", description: "Offset for pagination" }, token: { type: "string", description: "Filter by token address" }, chain: { type: "string", enum: ["svm", "evm"], description: "Filter by blockchain type" } }, additionalProperties: false, $schema: "http://json-schema.org/draft-07/schema#" } },
  • MCP CallToolRequest handler for 'get_trades': validates arguments, constructs TradeHistoryParams object, calls tradingClient.getTradeHistory(), and formats response.
    case "get_trades": { if (!args || typeof args !== "object") { throw new Error("Invalid arguments for get_trades"); } const tradeParams: TradeHistoryParams = {}; if ("limit" in args) tradeParams.limit = args.limit as number; if ("offset" in args) tradeParams.offset = args.offset as number; if ("token" in args) tradeParams.token = args.token as string; if ("chain" in args) tradeParams.chain = args.chain as BlockchainType; const response = await tradingClient.getTradeHistory(tradeParams); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }], isError: false }; }
  • Supporting utility in TradingSimulatorClient: builds URL query string from TradeHistoryParams and executes HTTP GET request to '/api/account/trades' via the internal request() method.
    async getTradeHistory(options?: TradeHistoryParams): Promise<TradeHistoryResponse | ErrorResponse> { let path = '/api/account/trades'; // Add query parameters if provided if (options) { const params = new URLSearchParams(); if (options.limit !== undefined) { params.append('limit', options.limit.toString()); } if (options.offset !== undefined) { params.append('offset', options.offset.toString()); } if (options.token) { params.append('token', options.token); } if (options.chain) { params.append('chain', options.chain); } // Append query string if we have parameters const queryString = params.toString(); if (queryString) { path += `?${queryString}`; } } return this.request<TradeHistoryResponse>( 'GET', path, null, 'get trade history' ); }
  • TypeScript interface definition for TradeHistoryParams, matching the input schema parameters for the get_trades tool.
    export interface TradeHistoryParams { limit?: number; offset?: number; token?: string; chain?: BlockchainType; }

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