Skip to main content
Glama
snjyor

Binance Cryptocurrency MCP

by snjyor

get_rolling_window_ticker

Retrieve rolling window ticker data for cryptocurrency trading pairs from Binance, specifying window size and data type for market analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolNoTrading pair symbol, e.g. BTCUSDT
symbolsNoArray of multiple trading pair symbols
windowSizeNoWindow size, e.g. 1m, 4h, 1d
typeNoReturn data type, FULL or MINI

Implementation Reference

  • Handler function that constructs parameters from input args and fetches rolling window ticker statistics from Binance API endpoint /api/v3/ticker, returning JSON data or error message.
    async (args: { symbol?: string; symbols?: string[]; windowSize?: string; type?: "FULL" | "MINI" }) => { try { let params: any = {}; if (args.symbol) { params.symbol = args.symbol; } else if (args.symbols) { params.symbols = JSON.stringify(args.symbols); } if (args.windowSize) params.windowSize = args.windowSize; if (args.type) params.type = args.type; const response = await axios.get(`${BASE_URL}/api/v3/ticker`, { params, proxy: getProxy(), }); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }] }; } catch (error: any) { return { content: [{ type: "text", text: `Failed to get rolling window price statistics: ${error.message}` }], isError: true }; } }
  • Zod schema defining optional input parameters: single symbol, array of symbols, windowSize (e.g., 1m), and type (FULL or MINI).
    { symbol: z.string().optional().describe("Trading pair symbol, e.g. BTCUSDT"), symbols: z.array(z.string()).optional().describe("Array of multiple trading pair symbols"), windowSize: z.string().optional().describe("Window size, e.g. 1m, 4h, 1d"), type: z.enum(["FULL", "MINI"]).optional().describe("Return data type, FULL or MINI") },
  • src/index.ts:367-400 (registration)
    Registration of the 'get_rolling_window_ticker' tool via server.tool(), including name, input schema, and inline handler function.
    server.tool( "get_rolling_window_ticker", { symbol: z.string().optional().describe("Trading pair symbol, e.g. BTCUSDT"), symbols: z.array(z.string()).optional().describe("Array of multiple trading pair symbols"), windowSize: z.string().optional().describe("Window size, e.g. 1m, 4h, 1d"), type: z.enum(["FULL", "MINI"]).optional().describe("Return data type, FULL or MINI") }, async (args: { symbol?: string; symbols?: string[]; windowSize?: string; type?: "FULL" | "MINI" }) => { try { let params: any = {}; if (args.symbol) { params.symbol = args.symbol; } else if (args.symbols) { params.symbols = JSON.stringify(args.symbols); } if (args.windowSize) params.windowSize = args.windowSize; if (args.type) params.type = args.type; const response = await axios.get(`${BASE_URL}/api/v3/ticker`, { params, proxy: getProxy(), }); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }] }; } catch (error: any) { return { content: [{ type: "text", text: `Failed to get rolling window price statistics: ${error.message}` }], 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/snjyor/binance-mcp'

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