Skip to main content
Glama

get-exchange-info

Retrieve detailed exchange information and status, including market types like spot, future, and swap, by specifying the exchange ID through the CCXT MCP Server.

Instructions

Get exchange information and status

Input Schema

NameRequiredDescriptionDefault
exchangeYesExchange ID (e.g., binance, coinbase)
marketTypeNoMarket type (default: spot)

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "exchange": { "description": "Exchange ID (e.g., binance, coinbase)", "type": "string" }, "marketType": { "description": "Market type (default: spot)", "enum": [ "spot", "future", "swap", "option", "margin" ], "type": "string" } }, "required": [ "exchange" ], "type": "object" }

Implementation Reference

  • Handler function that executes the tool logic: resolves exchange, applies rate limiting and caching, calls ex.fetchStatus(), formats response or error.
    }, async ({ exchange, marketType }) => { try { return await rateLimiter.execute(exchange, async () => { const ex = marketType ? getExchangeWithMarketType(exchange, marketType) : getExchange(exchange); const cacheKey = `status:${exchange}:${marketType || 'spot'}`; const info = await getCachedData(cacheKey, async () => { log(LogLevel.INFO, `Fetching status information for ${exchange}`); return await ex.fetchStatus(); }, 300000); // Cache for 5 minutes return { content: [{ type: "text", text: JSON.stringify(info, null, 2) }] }; }); } catch (error) { log(LogLevel.ERROR, `Error fetching exchange information: ${error instanceof Error ? error.message : String(error)}`); return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } });
  • Zod schema for input parameters: exchange (required string), marketType (optional enum).
    exchange: z.string().describe("Exchange ID (e.g., binance, coinbase)"), marketType: z.enum(["spot", "future", "swap", "option", "margin"]).optional().describe("Market type (default: spot)")
  • Registration of the 'get-exchange-info' tool using server.tool(), including schema and inline handler implementation.
    server.tool("get-exchange-info", "Get exchange information and status", { exchange: z.string().describe("Exchange ID (e.g., binance, coinbase)"), marketType: z.enum(["spot", "future", "swap", "option", "margin"]).optional().describe("Market type (default: spot)") }, async ({ exchange, marketType }) => { try { return await rateLimiter.execute(exchange, async () => { const ex = marketType ? getExchangeWithMarketType(exchange, marketType) : getExchange(exchange); const cacheKey = `status:${exchange}:${marketType || 'spot'}`; const info = await getCachedData(cacheKey, async () => { log(LogLevel.INFO, `Fetching status information for ${exchange}`); return await ex.fetchStatus(); }, 300000); // Cache for 5 minutes return { content: [{ type: "text", text: JSON.stringify(info, null, 2) }] }; }); } catch (error) { log(LogLevel.ERROR, `Error fetching exchange information: ${error instanceof Error ? error.message : String(error)}`); return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } });

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/doggybee/mcp-server-ccxt'

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