Skip to main content
Glama

get_positions

Retrieve current trading positions on Bybit exchange to monitor open trades, view position details, and manage portfolio exposure.

Instructions

Get position information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYesCategory (spot, linear, inverse, etc.)
symbolNoSymbol (e.g., BTCUSDT)

Implementation Reference

  • Core handler function that makes the Bybit API request to /v5/position/list to retrieve position information.
    async getPositions(category: string, symbol?: string): Promise<BybitResponse<{ list: Position[] }> | { error: string }> {
      const params: any = { category };
      if (symbol) {
        params.symbol = symbol;
      } else {
        // Add settleCoin for linear/inverse when no symbol specified
        if (category === 'linear') {
          params.settleCoin = 'USDT';
        } else if (category === 'inverse') {
          params.settleCoin = 'BTC';
        }
      }
      return this.makeBybitRequest('/v5/position/list', 'GET', params);
    }
  • MCP tool call handler that delegates to BybitService.getPositions and formats the response.
    case 'get_positions': {
      const result = await this.bybitService.getPositions(typedArgs.category, typedArgs.symbol);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Input schema and metadata for the get_positions tool, registered in ListTools response.
    {
      name: 'get_positions',
      description: 'Get position information',
      inputSchema: {
        type: 'object',
        properties: {
          category: {
            type: 'string',
            description: 'Category (spot, linear, inverse, etc.)',
          },
          symbol: {
            type: 'string',
            description: 'Symbol (e.g., BTCUSDT)',
          },
        },
        required: ['category'],
      },
    },
  • TypeScript interface defining the Position object structure used in getPositions response.
    export interface Position {
      symbol: string;
      side: string;
      size: string;
      avgPrice: string;
      positionValue: string;
      tradeMode: number;
      positionIdx: number;
      riskId: number;
      riskLimitValue: string;
      entryPrice: string;
      markPrice: string;
      liqPrice: string;
      bustPrice: string;
      positionMM: string;
      positionIM: string;
      tpslMode: string;
      takeProfit: string;
      stopLoss: string;
      trailingStop: string;
      unrealisedPnl: string;
      cumRealisedPnl: string;
      sessionAvgPrice: string;
      sessionUPL: string;
      leverage: string;
      autoAddMargin: number;
      positionStatus: string;
      adlRankIndicator: number;
      isReduceOnly: boolean;
      mmrSysUpdatedTime: string;
      leverageSysUpdatedTime: string;
      createdTime: string;
      updatedTime: string;
      seq: number;
    }
Behavior1/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 but fails to add any context. It doesn't specify if this is a read-only operation, requires authentication, has rate limits, returns real-time or historical data, or what the output format might be. This leaves critical behavioral traits undocumented.

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 with a single sentence, 'Get position information', which is front-loaded and wastes no words. While it's under-specified, it earns a high score for conciseness as every word serves the core purpose without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity implied by sibling tools in a trading context, no annotations, and no output schema, the description is severely incomplete. It doesn't explain what 'position information' entails, how results are structured, or any behavioral aspects, making it inadequate for an AI agent to use effectively without guesswork.

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

Parameters3/5

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

The description adds no meaning beyond the input schema, which has 100% coverage with clear descriptions for both parameters ('category' and 'symbol'). Since the schema fully documents the parameters, the baseline score is 3, as the description doesn't compensate but also doesn't detract from the schema's information.

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

Purpose2/5

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

The description 'Get position information' restates the tool name 'get_positions' with minimal elaboration, making it tautological. It specifies the verb 'Get' and resource 'position information' but lacks specificity about what kind of information (e.g., open positions, all positions, or specific details) and doesn't distinguish it from siblings like 'get_open_orders' or 'get_wallet_balance' that might also retrieve trading-related data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/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. It doesn't mention prerequisites, context (e.g., for trading analysis or risk management), or exclusions, leaving the agent with no hints about appropriate scenarios compared to sibling tools like 'get_open_orders' or 'get_wallet_balance'.

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/kondisettyravi/mcp-bybit-node'

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