Skip to main content
Glama

Reconcile realized PnL against the daily loss cap

reconcile_realized_pnl
Destructive

Counts the venue's realized LOSSES against the daily risk counters. A trade closed by the VENUE's own stop never goes through the close path, so without this the daily loss cap can never fire on it. Idempotent: each venue trade is counted exactly once, tracked in the realized-PnL ledger. Never moves funds, never places an order. Returns how many trades were counted, the loss recorded, and what was skipped and why.

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

Input Schema

NameRequiredDescriptionDefault
daysNoHow far back to reconcile, in days, 1..30 (default 2)
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

A4.2/5.0
Behavior4/5

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

Annotations already flag a mutating, open-world, destructive-profile call, and the description adds real context beyond them: idempotency with per-trade ledger tracking, no fund movement, no order placement, and the content of the return value. It does not explain why destructiveHint is true or what state is written/overwritten by the ledger, which keeps it short of 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.

Conciseness5/5

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

Four short sentences, front-loaded with the action, then the motivating gap, then the safety/idempotency profile, then the return shape. Nothing is redundant with the title or the schema, and every sentence carries information an agent needs.

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?

With no output schema, the description usefully previews the return (counted trades, loss recorded, skipped items with reasons), which is exactly what an agent needs after an idempotent bulk reconcile. Minor gaps remain around which counters are touched and how errors or partial failures surface.

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 coverage is 100%, so days, exchange, and connectionId (including the precedence rule) are already fully documented in the schema. The description adds no format, default-override, or range guidance beyond that, so the baseline 3 applies.

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

Purpose5/5

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

The description states a specific verb and resource ('Counts the venue's realized LOSSES against the daily risk counters') and immediately carves out the case that makes this tool distinct: venue-stop-closed trades that never pass through the close path. That scope statement is enough to separate it from read_closed_pnl-style tools without opening a schema.

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

Usage Guidelines4/5

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

It gives a clear condition for use: without this call, the daily loss cap cannot fire on venue-initiated stops. What's missing is any explicit exclusion or named alternative (e.g., when to just use read_closed_pnl or read_risk_limits instead), so the agent must infer the boundary.

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.