Skip to main content
Glama

fetchOrder

Retrieve detailed information about a specific cryptocurrency trading order using account credentials, order ID, and trading symbol.

Instructions

Fetch information about a specific order using a configured account

Input Schema

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

Implementation Reference

  • The handler function executes the fetchOrder tool by getting the CCXT exchange instance for the account, checking support for fetchOrder, calling exchange.fetchOrder(id, symbol, params), and returning the JSON stringified order or an 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, }; } },
  • Zod input schema validating accountName (string), id (string), symbol (string), and optional params (record). Includes descriptions for each parameter.
    { 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"), },
  • The server.tool call that registers the fetchOrder tool with its name, description, input schema, and handler function.
    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 function within CcxtMcpServer's registerTools method, which includes registration of the fetchOrder tool.
    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