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

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

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
        };
      }
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves information but doesn't clarify what 'information and status' entails, whether it's read-only, requires authentication, has rate limits, or returns structured data. For a tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words, making it easy to parse. However, it could be more front-loaded with critical details like the tool's scope or differentiation from siblings, though it remains appropriately concise for its content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of financial exchange tools, no annotations, and no output schema, the description is insufficient. It doesn't explain what 'information and status' includes, how results are formatted, or error handling, leaving gaps for an agent to operate effectively in this domain.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear descriptions for both parameters, including an enum for 'marketType'. The description adds no additional parameter semantics beyond what the schema provides, such as examples of exchange IDs beyond 'binance' or 'coinbase', or details on default behavior. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool's purpose as 'Get exchange information and status', which is a clear verb+resource combination. However, it doesn't differentiate from sibling tools like 'list-exchanges' or 'get-market-types', leaving ambiguity about what specific information is retrieved. The purpose is understandable but lacks specificity compared to alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as 'list-exchanges' or 'get-market-types'. The description doesn't mention prerequisites, exclusions, or contextual cues for selection, leaving the agent to infer usage based on the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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