Skip to main content
Glama

binance_market_exchangeInfo

Retrieve exchange information and symbol filters to understand trading parameters and restrictions on Binance.

Instructions

Get exchange information including filters per symbol.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler implementation of the 'binance_market_exchangeInfo' tool. Defines the tool object with name, description, parameters schema reference, and the async run() function that fetches exchangeInfo from the binance client and returns the data, handling errors with toToolError.
    export const tool_exchange_info: BinanceTool = { name: "binance_market_exchangeInfo", description: "Get exchange information including filters per symbol.", parameters: exchangeInfoSchema, async run() { try { const res = await binance.exchangeInfo(); return res.data; } catch (err) { throw toToolError(err); } } };
  • Zod input schema for the tool (empty object since no parameters required).
    const exchangeInfoSchema = z.object({});
  • src/index.ts:15-23 (registration)
    The tools array that includes 'tool_exchange_info' which is then registered to the FastMCP server.
    const tools = [ tool_market_price, tool_market_klines, tool_exchange_info, tool_account_balances, tool_open_orders, tool_place_order, tool_cancel_order, ];
  • src/index.ts:25-40 (registration)
    The registration loop that adds the 'binance_market_exchangeInfo' tool (and others) to the MCP server using server.addTool, wrapping the tool's run function in an execute handler with JSON formatting and error handling.
    tools.forEach((tool) => { server.addTool({ name: tool.name, description: tool.description, parameters: tool.parameters, execute: async (args) => { try { const result = await tool.run(args); return JSON.stringify(result, null, 2); } catch (error) { const handled = error instanceof ToolError ? error : new ToolError((error as Error).message); throw handled; } }, }); });
  • Helper function toToolError used in the tool handler to convert errors (e.g., from Binance API) into standardized ToolError instances.
    export function toToolError(err: unknown): ToolError { const message = extractMessage(err); return new ToolError(message); }

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/Valerio357/binance-mcp'

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