Skip to main content
Glama

TradingCalc MCP — Crypto Futures Math

workflow.run_pnl_planning

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 (%).

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. 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"
  2. Added

TDQS

A4.3/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses the return fields (grossPnl, fees, netPnl, netPnlUsdt, roe) which helps, but it does not mention whether the tool has side effects, requires authentication, or any edge-case behavior. A pure calculation tool likely has none, but this is not explicitly stated.

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?

The description is a single purpose sentence plus a trigger and return list. It is tightly written, front-loads the core function, and contains no redundant or vague phrases.

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?

The return list compensates for the missing output schema, and the contractType parameter explains the difference between linear and inverse margins. However, error conditions (e.g., division by zero, invalid contract type) are not mentioned, which is a minor gap for a calculation tool.

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

Parameters5/5

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

Schema coverage is 100% with detailed descriptions. Parameters include units (fraction for fees, base coin vs USDT for contractType), examples (0.0002 = 0.02%), and distinctions (linear vs inverse). The descriptions add significant meaning beyond field names.

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 clearly states the tool calculates net PnL, ROE, fees, and gross profit/loss for a futures trade. It uses specific verbs and resource scope, distinguishing it from sibling workflows like funding cost or liquidation safety.

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?

The description provides a concrete trigger ('when user asks what's my profit/loss on this trade?') and specifies the input context. It does not explicitly mention alternative tools, but the unique function makes the choice unambiguous for the given user query.

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.