Skip to main content
Glama

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

Risk Reward

workflow.run_risk_reward
Read-only

Full risk:reward analysis: takes a trade with entry, stop, AND target (all three). Calculates R:R ratio, position size, liquidation price, breakeven, and P&L at both stop and target. Returns a verdict label, strong (3:1+) / good (2:1+) / marginal / poor, which grades the R:R ratio against fixed thresholds and is not a recommendation. For a full setup check tied to a live exchange/symbol (including funding cost), see workflow.run_pre_trade_check; its verdict covers overall setup safety, not just R:R. Edge cases: entry_price, stop_loss, take_profit, account_balance and leverage above zero; risk_pct above 0 and at most 100; fee_open_pct and fee_close_pct are fractions from 0 to 0.05 (defaults 0.0002 and 0.0005); mmr 0 to 0.2 as a fraction (0.005 is 0.5%); liqFeeRate 0 to 0.05. Stop and target distances are taken as absolute values from the entry, so a stop or target on the wrong side for the chosen side is not rejected: check the side yourself. Not covered: funding payments, slippage, partial fills, exchange tiered margin (use workflow.run_liquidation_live) and any guarantee that a stop fills at its price. Use when user asks "what's my risk reward on this setup?" or "what R:R do this entry, stop and target give?". liquidation_price and the liquidation distance are null when the position cannot be liquidated (an inverse short at 1x or less): check for null before using them.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "side": "<side>",
      "entry_price": "<entry_price>",
      "stop_loss": "<stop_loss>",
      "take_profit": "<take_profit>",
      "account_balance": "<account_balance>",
      "risk_pct": "<risk_pct>",
      "leverage": "<leverage>"
    },
    "name": "workflow.run_risk_reward"
  }
}

Input Schema

NameRequiredDescriptionDefault
mmrNoMaintenance margin rate as a fraction, 0 to 0.2 (default 0.005 = 0.5%); not a percent: 0.5% is 0.005, not 0.5
sideYesTrade direction: "long" or "short"
mmBaseNoValue the maintenance margin is taken on: "liquidation" = position value at the liquidation price (default), "entry" = entry value.
leverageYesLeverage multiplier
risk_pctYesMax risk as % of account
stop_lossYesStop-loss price
liqFeeRateNoLiquidation fee as a fraction of position value, default 0, max 0.05; added to mmr.
entry_priceYesEntry price
take_profitYesTake-profit price
contractTypeNolinear = USDT-margined (default), inverse = coin-margined (e.g. Bybit BTCUSD). position_size/notional are USD notional (contracts) for inverse; pnl_at_stop/pnl_at_target come back denominated in the base coin.
fee_open_pctNoOpen fee rate (default 0.0002)
fee_close_pctNoClose fee rate (default 0.0005)
account_balanceYesAccount balance in USDT

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / mmr / description
      Previous value: -"Maintenance margin rate (default 0.005)"New value: +"Maintenance margin rate as a fraction, 0 to 0.2 (default 0.005 = 0.5%); not a percent: 0.5% is 0.005, not 0.5"
    • addedInput schema / properties / mmr / maximum
      Added value: +0.2
    • addedInput schema / properties / mmr / minimum
      Added value: +0
  2. Changed2 schema fields changed
    • addedInput schema / properties / liqFeeRate
      Added value: +{
      +  "description": "Liquidation fee as a fraction of position value, default 0, max 0.05; added to mmr.",
      +  "type": "number"
      +}
    • addedInput schema / properties / mmBase
      Added value: +{
      +  "description": "Value the maintenance margin is taken on: \"liquidation\" = position value at the liquidation price (default), \"entry\" = entry value.",
      +  "enum": [
      +    "liquidation",
      +    "entry"
      +  ],
      +  "type": "string"
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / side / description
      Added value: +"Trade direction: \"long\" or \"short\""
  4. Changed1 schema field changed
    • addedInput schema / properties / contractType
      Added value: +{
      +  "description": "linear = USDT-margined (default), inverse = coin-margined (e.g. Bybit BTCUSD). position_size/notional are USD notional (contracts) for inverse; pnl_at_stop/pnl_at_target come back denominated in the base coin.",
      +  "enum": [
      +    "linear",
      +    "inverse"
      +  ],
      +  "type": "string"
      +}
  5. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already establish read-only, non-destructive, closed-world behavior. The description adds substantial context beyond that: the exact outputs, the strong/good/marginal/poor thresholds, validation constraints, the fact that wrong-side stops/targets are not rejected, exclusions such as funding and slippage, and null liquidation-price behavior.

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?

The description is front-loaded with purpose, calculations, and the key alternative, then moves through edge cases, exclusions, and null handling. It is long and the edge-case sentence is a dense semicolon-separated run-on, but nearly every clause adds actionable information for a complex 13-parameter tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool complexity, 13 parameters, and no output schema, the description is unusually complete. It enumerates outputs, verdict semantics, validation rules, exclusions, and a null-result case, and the annotations already cover the safety profile. An agent has enough information to call the tool correctly and interpret its main 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?

Schema coverage is 100%, so the schema already documents parameter meaning. The description still adds useful semantics: zero/positive constraints, risk_pct bounds, fee and mmr/liqFeeRate fraction ranges and defaults, and the important rule that stop and target distances are taken as absolute values from entry. It does not add much beyond the schema for a few parameters such as mmBase and contractType, but overall it meaningfully supplements the schema.

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: full risk:reward analysis for a trade with entry, stop, and target. It lists the exact calculations performed (R:R, position size, liquidation price, breakeven, P&L) and distinguishes the result from a broader setup check by naming workflow.run_pre_trade_check. An agent can tell what this tool does and what it does not do 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 Guidelines5/5

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

It gives explicit use cases ('what's my risk reward on this setup?' and 'what R:R do this entry, stop and target give?') and explicitly routes full live-exchange/setup checks to workflow.run_pre_trade_check. It also clarifies that the verdict grades only R:R and is not a recommendation, which prevents misuse of the output.

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.