Skip to main content
Glama

TradingCalc MCP: Options, Forex, Risk Stats, Prediction Markets, On-Chain & Crypto Futures

PnL Planning

workflow.run_pnl_planning
Read-only

Calculate net PnL, ROE, fees and gross profit/loss for a futures trade. Use when user asks "what's my profit/loss on this trade?" Returns: grossPnl, fees, netPnl, netPnlUsdt, roe (%), maxLossBound (only non-null for an inverse/coin-margined short: the finite ceiling on net coin-denominated loss as price rises without limit, (size/entryPrice)×(1+feeOpenPct) - includes the opening fee, since it survives the exit-price-to-infinity limit while the closing fee vanishes - null for every other side/contractType combination, which either has no such bound or a trivial one).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sideYesTrade direction
sizeYesPosition size: base asset qty for linear, USD contracts for inverse
exitPriceYesExit price (positive)
entryPriceYesEntry price (positive)
feeOpenPctNoOpening fee as fraction, e.g. 0.0002 = 0.02%
feeClosePctNoClosing fee as fraction
contractTypeNolinear = USDT-margined (default), inverse = coin-margined. For inverse, pnl/fees are returned in the base coin, not USDT.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / size / description
      Previous value: -"Position size — base asset qty for linear, USD contracts for inverse"New value: +"Position size: base asset qty for linear, USD contracts for inverse"
  2. Changed2 schema fields changed
    • addedInput schema / properties / contractType
      Added value: +{
      +  "description": "linear = USDT-margined (default), inverse = coin-margined. For inverse, pnl/fees are returned in the base coin, not USDT.",
      +  "enum": [
      +    "linear",
      +    "inverse"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / size / description
      Previous value: -"Position size in base asset"New value: +"Position size — base asset qty for linear, USD contracts for inverse"
  3. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=false, so safety is covered. The description goes further by enumerating the returned fields and giving a genuine edge-case disclosure (maxLossBound is non-null only for inverse/coin-margined shorts, includes the opening fee, null otherwise). That is real behavioral context beyond structured data, though it is buried in a dense sentence.

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

Conciseness3/5

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

The purpose sentence and return-field list are front-loaded and efficient, but the maxLossBound clause is a single ~70-word parenthetical with nested asides that is hard to parse and could be split or trimmed. Roughly half the description's weight sits in an over-stuffed sentence.

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 correctly carries the return-value burden by naming grossPnl, fees, netPnl, netPnlUsdt, roe and maxLossBound. With annotations covering the safety profile and the schema covering all params, this is nearly complete; only the unwieldy maxLossBound phrasing weakens it.

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 every parameter (side, size, entryPrice, exitPrice, feeOpenPct, feeClosePct, contractType) is already documented with units and semantics. The description adds only one parameter-related fact (inverse PnL/fees are in base coin) which the schema also states, 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?

States a specific verb (calculate) and resource list (net PnL, ROE, fees, gross P/L) scoped to 'a futures trade', which distinguishes it from the sibling run_forex_pnl. An agent can identify the tool's function without opening the 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?

Gives an explicit trigger phrase ('what's my profit/loss on this trade?') that maps user intent to this tool. It does not name when-not-to-use or point at alternatives such as run_forex_pnl or run_breakeven_planning, so it stops short of full routing guidance.

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.