Skip to main content
Glama
ethancod1ng

Bybit MCP Server

by ethancod1ng

place_order

Execute trading orders on Bybit for spot, linear, inverse, and option markets using market or limit order types with configurable parameters.

Instructions

Place a new order (⚠️ WARNING: Can use real funds on mainnet)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYes
symbolYes
sideYes
orderTypeYes
qtyYes
priceNo
timeInForceNo

Implementation Reference

  • The core handler function in BybitClient that executes the place_order tool by calling Bybit's submitOrder API endpoint.
    async placeOrder(params: {
      category: string;
      symbol: string;
      side: string;
      orderType: string;
      qty: string;
      price?: string;
      timeInForce?: string;
    }) {
      try {
        if (this.config.environment === 'mainnet') {
          console.error('⚠️  WARNING: Placing order on MAINNET with real funds!');
        }
    
        const response = await this.client.submitOrder({
          category: params.category as any,
          symbol: params.symbol,
          side: params.side as any,
          orderType: params.orderType as any,
          qty: params.qty,
          price: params.price,
          timeInForce: params.timeInForce as any
        });
        return response;
      } catch (error) {
        throw new Error(`Failed to place order: ${error instanceof Error ? error.message : JSON.stringify(error)}`);
      }
    }
  • Zod schema defining the input parameters for the place_order tool.
    export const PlaceOrderSchema = z.object({
      category: z.enum(['spot', 'linear', 'inverse', 'option']).describe('Product type'),
      symbol: z.string().describe('Trading symbol'),
      side: z.enum(['Buy', 'Sell']).describe('Order side'),
      orderType: z.enum(['Market', 'Limit']).describe('Order type'),
      qty: z.string().describe('Order quantity'),
      price: z.string().optional().describe('Order price (required for limit orders)'),
      timeInForce: z.enum(['GTC', 'IOC', 'FOK']).optional().describe('Time in force (default: GTC)')
    });
  • src/tools.ts:88-95 (registration)
    Tool registration metadata including name, description, and input schema reference, included in the exported tools array used by the MCP server.
      name: 'place_order',
      description: 'Place a new order (⚠️ WARNING: Can use real funds on mainnet)',
      inputSchema: {
        type: 'object',
        properties: PlaceOrderSchema.shape,
        required: ['category', 'symbol', 'side', 'orderType', 'qty']
      }
    },
  • Dispatch handler in MCP server that routes 'place_order' tool calls to the BybitClient.placeOrder method.
    case 'place_order':
      result = await this.client.placeOrder({
        category: args.category as string,
        symbol: args.symbol as string,
        side: args.side as string,
        orderType: args.orderType as string,
        qty: args.qty as string,
        price: args.price as string,
        timeInForce: args.timeInForce as string,
      });
      break;
Behavior4/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. The warning '⚠️ WARNING: Can use real funds on mainnet' is crucial behavioral information that alerts the agent to the financial risk and real-world consequences of this operation. This goes beyond what the input schema provides and is essential for safe tool invocation.

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 - just one sentence with a warning. Every word earns its place: 'Place a new order' states the purpose, and the warning provides critical behavioral context. There's no fluff or unnecessary elaboration.

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 complex financial transaction tool with 7 parameters, 0% schema description coverage, no annotations, and no output schema, the description is inadequate. While the warning about real funds is valuable, the description fails to explain what the tool actually returns, how orders are processed, error conditions, or any of the parameter meanings. This leaves too many gaps for safe and effective use.

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 schema description coverage is 0%, meaning none of the 7 parameters have descriptions in the schema. The tool description provides absolutely no information about any parameters - it doesn't mention category, symbol, side, orderType, qty, price, or timeInForce. This leaves all parameter meanings completely undocumented in both schema and description.

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 action ('Place a new order') and resource ('order'), which is specific and unambiguous. However, it doesn't differentiate from sibling tools like 'cancel_order' or 'cancel_all_orders' beyond the basic verb distinction, and the warning about real funds is a behavioral note rather than purpose clarification.

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. While it warns about real funds, it doesn't mention when to use 'place_order' versus other trading tools like 'get_open_orders' or 'cancel_order', nor does it specify prerequisites or appropriate contexts for order placement.

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