Skip to main content
Glama

fetchOrder

Retrieve detailed information about a specific cryptocurrency order using account credentials, order ID, and trading symbol with the CCXT MCP Server. Supports additional exchange-specific parameters for tailored queries.

Instructions

Fetch information about a specific order using a configured account

Input Schema

NameRequiredDescriptionDefault
accountNameYesAccount name defined in the configuration file (e.g., 'bybit_main')
idYesOrder ID to fetch
paramsNoAdditional exchange-specific parameters
symbolYesTrading symbol (e.g., 'BTC/USDT')

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "accountName": { "description": "Account name defined in the configuration file (e.g., 'bybit_main')", "type": "string" }, "id": { "description": "Order ID to fetch", "type": "string" }, "params": { "additionalProperties": {}, "description": "Additional exchange-specific parameters", "type": "object" }, "symbol": { "description": "Trading symbol (e.g., 'BTC/USDT')", "type": "string" } }, "required": [ "accountName", "id", "symbol" ], "type": "object" }

Implementation Reference

  • Handler for the 'fetchOrder' tool: retrieves exchange instance, checks support for fetchOrder, calls exchange.fetchOrder(id, symbol, params), returns JSON or error response.
    async ({ accountName, id, symbol, params }) => { try { const exchange = ccxtServer.getExchangeInstance(accountName); // getExchangeInstance가 성공하면 인증은 보장됨 // fetchOrder 메서드가 지원되는지 확인 if (!exchange.has["fetchOrder"]) { return { content: [ { type: "text", text: `Account '${accountName}' (Exchange: ${exchange.id}) does not support fetching order details`, }, ], isError: true, }; } const order = await exchange.fetchOrder(id, symbol, params); return { content: [ { type: "text", text: JSON.stringify(order, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error fetching order for account '${accountName}': ${ (error as Error).message }`, }, ], isError: true, }; } },
  • Input schema using Zod for 'fetchOrder' tool parameters: accountName (string), id (string), symbol (string), params (optional record).
    { accountName: z .string() .describe( "Account name defined in the configuration file (e.g., 'bybit_main')" ), id: z.string().describe("Order ID to fetch"), symbol: z.string().describe("Trading symbol (e.g., 'BTC/USDT')"), params: z .record(z.any()) .optional() .describe("Additional exchange-specific parameters"), },
  • Registration of the 'fetchOrder' tool on the MCP server within registerOrderTools function, including name, description, input schema, and handler.
    server.tool( "fetchOrder", "Fetch information about a specific order using a configured account", { accountName: z .string() .describe( "Account name defined in the configuration file (e.g., 'bybit_main')" ), id: z.string().describe("Order ID to fetch"), symbol: z.string().describe("Trading symbol (e.g., 'BTC/USDT')"), params: z .record(z.any()) .optional() .describe("Additional exchange-specific parameters"), }, async ({ accountName, id, symbol, params }) => { try { const exchange = ccxtServer.getExchangeInstance(accountName); // getExchangeInstance가 성공하면 인증은 보장됨 // fetchOrder 메서드가 지원되는지 확인 if (!exchange.has["fetchOrder"]) { return { content: [ { type: "text", text: `Account '${accountName}' (Exchange: ${exchange.id}) does not support fetching order details`, }, ], isError: true, }; } const order = await exchange.fetchOrder(id, symbol, params); return { content: [ { type: "text", text: JSON.stringify(order, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error fetching order for account '${accountName}': ${ (error as Error).message }`, }, ], isError: true, }; } }, );
  • src/server.ts:373-373 (registration)
    Top-level call to registerOrderTools in CcxtMcpServer's registerTools method, which registers the fetchOrder tool among others.
    registerOrderTools(this.server, this);

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/lazy-dinosaur/ccxt-mcp'

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