Skip to main content
Glama

Binance MCP Server

binanceOrderBook.ts1.02 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import { spotClient } from "../config/client.js"; export function registerBinanceOrderBook(server: McpServer) { server.tool( "binanceOrderBook", "check binance order book", { symbol: z.string().describe("symbol: exemple: BTCUSDT"), }, async ({ symbol }) => { try { const orderBook = await spotClient.orderBook(symbol, {limit: 50}); return { content: [ { type: "text", text: `Get binance order book successfully. data: ${JSON.stringify(orderBook)}}`, }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: "text", text: `Server failed: ${errorMessage}` }, ], 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/TermiX-official/binance-mcp'

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