Skip to main content
Glama

Read closed CEX PnL

read_closed_pnl
Read-only

READ-ONLY: realized/closed-PnL history on a CEX connection (one row per closed position carrying net pnl + fees, for diary sync). Never moves funds. Rows whose venue reports no side stay null — side is never inferred from the PnL sign; Binance rows carry entryPrice 0 = unknown (the income feed has no entry price) and exitPrice is the paired closing fill when one was found.

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": "read_closed_pnl"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNoLookback in days, 1..90 (default 30)
pairNoOptional filter, e.g. BTC/USDT
limitNoMax rows, newest-first, 1..500 (default 100)
exchangeNoCEX slug, e.g. kucoin (resolved to an active connection; connectionId wins when both are given)
connectionIdNoCEX connection id (see list_connections). Takes precedence over exchange.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover readOnlyHint and openWorldHint, but the description adds real data-shape behavior: rows with no reported side stay null, side is never inferred from the PnL sign, and Binance entryPrice 0 means unknown. These caveats materially change how an agent should interpret results and are not in the annotations; only the absence of ordering/pagination detail keeps it off a 5.

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

Conciseness4/5

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

Two sentences and both are dense with useful content; the READ-ONLY safety note is front-loaded. The second sentence is long and mixes several unrelated caveats, which costs a little clarity but nothing is pure filler.

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?

There is no output schema, so the description takes on return-value explanation and does so for the key fields (pnl, fees, side, entryPrice, exitPrice). It leaves out newer-first ordering confirmation and any indication of empty-result behavior, so it is strong but not fully complete for a five-parameter history tool.

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 the schema already explains days, pair, limit, exchange and connectionId. The description adds no parameter-level meaning (for example, what 'days' means at the venue boundary or how exchange vs connectionId resolution behaves in practice), so the 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?

The description names a specific verb and resource ('realized/closed-PnL history on a CEX connection') and clarifies granularity ('one row per closed position carrying net pnl + fees'), plus a stated purpose ('for diary sync'). It does not explicitly position itself against the closest sibling, reconcile_realized_pnl, 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 'for diary sync' phrasing and the READ-ONLY framing imply the read-only retrieval use case, but there is no explicit when-to-use or when-not-to-use guidance. Nothing tells the agent whether to prefer this over reconcile_realized_pnl or how it relates to list_fills.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.