Skip to main content
Glama

binance_account_openOrders

List open orders for a specific trading symbol on Binance to monitor pending transactions and manage active positions.

Instructions

List open orders for a symbol.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYes

Implementation Reference

  • The main handler implementation for the 'binance_account_openOrders' tool. It parses input, calls binance.openOrders with the symbol, and returns the data or throws a tool error.
    export const tool_open_orders: BinanceTool = {
      name: "binance_account_openOrders",
      description: "List open orders for a symbol.",
      parameters: openOrdersSchema,
      async run(input) {
        const params = openOrdersSchema.parse(input);
        try {
          const res = await binance.openOrders(params.symbol, withCommonParams({}));
          return res.data;
        } catch (err) {
          throw toToolError(err);
        }
      }
    };
  • Zod schema defining the input parameters for the tool: an object with a required 'symbol' string.
    const openOrdersSchema = z.object({ symbol: z.string().min(1) });
  • src/index.ts:15-40 (registration)
    The tool 'tool_open_orders' (binance_account_openOrders) is included in the tools array and registered to the MCP server via a forEach loop that adds each tool with its name, description, parameters, and a wrapper execute function calling the tool's run method.
    const tools = [
      tool_market_price,
      tool_market_klines,
      tool_exchange_info,
      tool_account_balances,
      tool_open_orders,
      tool_place_order,
      tool_cancel_order,
    ];
    
    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;
          }
        },
      });
    });

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