Skip to main content
Glama
ethancod1ng

Bybit MCP Server

by ethancod1ng

get_open_orders

Retrieve active orders from Bybit trading accounts to monitor positions and manage trades across spot, linear, inverse, and option markets.

Instructions

Get list of open/active orders

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYes
symbolNo
limitNo

Implementation Reference

  • Core handler function that executes the tool logic by calling Bybit API's getActiveOrders.
    async getOpenOrders(category: string, symbol?: string, limit: number = 20) {
      try {
        const response = await this.client.getActiveOrders({
          category: category as any,
          symbol: symbol,
          limit: limit
        });
        return response;
      } catch (error) {
        throw new Error(`Failed to get open orders: ${error instanceof Error ? error.message : JSON.stringify(error)}`);
      }
    }
  • Server dispatch handler that routes the 'get_open_orders' tool call to the client implementation.
    case 'get_open_orders':
      result = await this.client.getOpenOrders(
        args.category as string,
        args.symbol as string,
        args.limit as number
      );
      break;
  • src/tools.ts:69-77 (registration)
    Tool registration defining name, description, and input schema reference.
    {
      name: 'get_open_orders',
      description: 'Get list of open/active orders',
      inputSchema: {
        type: 'object',
        properties: OpenOrdersSchema.shape,
        required: ['category']
      }
    },
  • Zod schema for input validation of get_open_orders parameters.
    export const OpenOrdersSchema = z.object({
      category: z.enum(['spot', 'linear', 'inverse', 'option']).describe('Product type'),
      symbol: z.string().optional().describe('Trading symbol'),
      limit: z.number().min(1).max(50).optional().describe('Number of records to return (default: 20)')
    });
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Get list' implies a read-only operation, it doesn't specify authentication requirements, rate limits, pagination behavior, or what constitutes 'open/active' orders. The description lacks critical behavioral context needed for safe and effective use.

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

Conciseness5/5

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

The description is extremely concise at just 5 words, front-loading the core purpose without any wasted words. Every word earns its place, and there's no unnecessary elaboration. This is a model of efficiency in tool description structure.

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?

For a tool with 3 parameters, no annotations, no output schema, and 0% schema description coverage, the description is severely incomplete. It doesn't explain what the tool returns, how parameters interact, or any behavioral constraints. The agent lacks sufficient context to use this tool effectively beyond the most basic understanding.

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

Parameters1/5

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

The description provides zero information about parameters, while the schema has 0% description coverage. With 3 parameters (category, symbol, limit) completely undocumented in both schema and description, the agent has no semantic understanding of what these parameters mean or how they affect the query. This is a critical gap.

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

Purpose4/5

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

The description clearly states the verb ('Get') and resource ('list of open/active orders'), making the purpose immediately understandable. However, it doesn't distinguish this tool from sibling tools like 'get_order_history' or 'cancel_order', which also deal with orders. The description is specific about the type of orders (open/active) but lacks differentiation from similar tools.

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?

The description provides no guidance on when to use this tool versus alternatives like 'get_order_history' or 'cancel_order'. There's no mention of prerequisites, use cases, or exclusions. The agent must infer usage from the tool name alone, which is insufficient for optimal tool selection.

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

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/ethancod1ng/bybit-mcp-server'

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