Skip to main content
Glama
bybit-exchange

Bybit MCP Server

Official

getClosedPnl

Read-only

Retrieve your closed profit and loss records from Bybit, filtered by symbol and time range, with results sorted newest first. Supports up to 2 years of data.

Instructions

Query user's closed profit and loss records. The results are sorted by createdTime in descending order.

  • Unified account covers: USDT perpetual / USDC contract

Time range rules:

  • Without both startTime and endTime: returns last 7 days by default

  • Only startTime provided: returns from startTime to startTime + 7 days

  • Only endTime provided: returns from endTime - 7 days to endTime

  • Both provided: endTime - startTime must be <= 7 days

Data retention: Up to 2 years

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
cursorNo
symbolNo
endTimeNo
categoryYes
startTimeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.11

TDQS

A4.1/5.0
Behavior5/5

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

The annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds substantial behavioral context beyond that: deterministic descending sort order, account/product coverage, subtle time-window defaulting rules under partial parameters, and a 2-year data-retention limit. No contradiction with the annotations.

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?

Well-structured and front-loaded: purpose first, then a scoped coverage note, then bulleted time-range rules, then a one-line retention caveat. The bullets make the dense window logic scannable, and every line earns its place—no filler or repetition of schema content.

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 read-only query tool, the description covers the highest-risk semantics: time-window defaults, constraints on combined ranges, instrument coverage, and retention. The only meaningful gaps are the absence of an output record shape (no output schema exists to compensate) and no mention of cursor-based pagination behavior across multiple pages of results.

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

Parameters4/5

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

With schema description coverage at 0%, the description carries the burden and it delivers for the two trickiest parameters: startTime and endTime get full combinatorial semantics (defaults, derived windows, 7-day max span). The 'Unified account' line adds context for category. However, limit, cursor, and symbol receive no prose explanation, though their schema constraints (default/max/min) partially self-explain for limit and cursor/symbol are conventional.

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 opening line, 'Query user's closed profit and loss records,' states a specific verb and resource, and adds useful scope details: sorting by createdTime descending and the instrument coverage (USDT perpetual / USDC contract). It is clear and unambiguous, but it does not explicitly differentiate from plausible siblings like getTransactionLog or getOrderHistory, so it stops short of a 5.

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?

The time-range rules provide strong operational context: calling without startTime/endTime defaults to the last 7 days, and partial parameter combinations derive a 7-day window. This implies when the tool can be used with minimal input, but there is no explicit when-to-use versus alternatives guidance or exclusions among the large sibling set.

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