Skip to main content
Glama
Bybit MCP Server

Bybit MCP Server

by trenerok

get_closed_pnl

Retrieve realized profit and loss history for closed positions, including entry and exit prices and actual PnL. Use filters like symbol, category, and time range to analyze trading performance.

Instructions

Get realized profit and loss history from closed positions. Shows entry/exit prices and actual PnL. Auth required.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_closed_pnl"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoNumber of results (default: 50, max: 100)
cursorNoPagination cursor
symbolNoTrading pair symbol
endTimeNoEnd timestamp in ms
categoryNoProduct categorylinear
startTimeNoStart timestamp in ms

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does add two useful facts: authentication is required and the payload contains entry/exit prices and actual realized PnL. It does not disclose pagination behavior, data retention/delay, default time window when startTime/endTime are omitted, or rate limits — meaningful gaps for a history endpoint.

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?

Three short sentences, front-loaded with the core purpose, then the returned data, then the auth constraint. Nothing is padded and no sentence merely restates the tool name.

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

Completeness4/5

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

For a six-parameter read endpoint with no output schema, the description usefully names the key return fields and the auth requirement, and pagination parameters are covered by the schema. The main missing piece is time-range/default behavior for startTime/endTime and cursor paging, which would round it out.

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?

Schema description coverage is 100%, so all six parameters (limit, cursor, symbol, startTime, endTime, category) are already documented in the schema. The description adds no filtering syntax, timestamp semantics, or interaction rules (e.g. how cursor relates to startTime/endTime), so baseline 3 applies.

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?

States a specific verb and resource: 'get realized profit and loss history from closed positions', and clarifies the scope ('closed positions', 'realized') which implicitly separates it from open-position tools like get_positions. It stops short of naming any sibling explicitly, so distinguishability depends on the reader inferring from scope keywords.

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

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the scope words 'closed positions' and 'realized PnL', which tell an agent this is historical, not live, position data. There is no explicit statement of when to use this versus e.g. get_positions or get_trade_history, and no preconditions beyond 'Auth required'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.