Skip to main content
Glama

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

Pre Trade Check

workflow.run_pre_trade_check
Read-only

Full pre-trade decision card: orchestrates position sizing, breakeven, liquidation, and funding cost in one call. Use when user describes a full trade setup and asks "should I take this trade?" or "run the numbers on this setup". Provide exchange+symbol to fetch live funding rate automatically. For an R:R-graded verdict on an entry, stop and target, see workflow.run_risk_reward. Returns: positionSize, breakeven, liquidationPrice, fundingCost, overnightBreakevenShift, verdict.

Input Schema

NameRequiredDescriptionDefault
mmrNoMaintenance margin rate, default 0.005
sideYesTrade direction: "long" or "short"
symbolNoPerpetual symbol, e.g. "BTCUSDT".
exchangeNoExchange code, e.g. "binance" or "bybit". Used to fetch the live funding rate if funding_rate is omitted, and to set funding_interval_hours when that is omitted (1 for Hyperliquid, dYdX and Kraken, whose rates are per hour; pass funding_interval_hours: 8 if your rate is per 8 hours).
leverageYesLeverage multiplier
risk_pctYesRisk as % of balance, e.g. 1.0 = 1%
stop_lossYesStop-loss price (positive)
hold_hoursNoExpected hold time in hours for overnight shift calc. Default 8.
entry_priceYesEntry price (positive)
contractTypeNolinear = USDT-margined (default), inverse = coin-margined (e.g. Bybit BTCUSD). All returned figures (notional, margin, risk_amount, funding_cost_*) stay USD-denominated either way; recommended_size is USD notional (contracts) for inverse.
fee_open_pctNoOpening fee fraction, default 0.0002
funding_rateNoFunding rate per funding interval as decimal, e.g. 0.0001. If omitted, fetched live from exchange.
fee_close_pctNoClosing fee fraction, default 0.0005
account_balanceYesTotal account balance in USDT
funding_interval_hoursNoHours per funding payment: 8 or 1 (Hyperliquid, dYdX and Kraken, whose rate is per hour). Omitted: taken from exchange when given, else 8. When funding_rate is also omitted and fetched live, the exchange interval is always used, since the fetched rate is quoted per it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / exchange / description
      Previous value: -"Exchange code, e.g. \"binance\" or \"bybit\". Used to fetch live funding rate if funding_rate is omitted."New value: +"Exchange code, e.g. \"binance\" or \"bybit\". Used to fetch the live funding rate if funding_rate is omitted, and to set funding_interval_hours when that is omitted (1 for Hyperliquid, dYdX and Kraken, whose rates are per hour; pass funding_interval_hours: 8 if your rate is per 8 hours)."
    • addedInput schema / properties / funding_interval_hours
      Added value: +{
      +  "description": "Hours per funding payment: 8 or 1 (Hyperliquid, dYdX and Kraken, whose rate is per hour). Omitted: taken from exchange when given, else 8. When funding_rate is also omitted and fetched live, the exchange interval is always used, since the fetched rate is quoted per it.",
      +  "enum": [
      +    8,
      +    1
      +  ],
      +  "type": "number"
      +}
    • changedInput schema / properties / funding_rate / description
      Previous value: -"Funding rate per 8h as decimal, e.g. 0.0001. If omitted, fetched live from exchange."New value: +"Funding rate per funding interval as decimal, e.g. 0.0001. If omitted, fetched live from exchange."
  2. Changed1 schema field changed
    • addedInput schema / properties / side / description
      Added value: +"Trade direction: \"long\" or \"short\""
  3. Changed1 schema field changed
    • addedInput schema / properties / contractType
      Added value: +{
      +  "description": "linear = USDT-margined (default), inverse = coin-margined (e.g. Bybit BTCUSD). All returned figures (notional, margin, risk_amount, funding_cost_*) stay USD-denominated either way; recommended_size is USD notional (contracts) for inverse.",
      +  "enum": [
      +    "linear",
      +    "inverse"
      +  ],
      +  "type": "string"
      +}
  4. Added

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint=true, destructiveHint=false), so the description's value is in disclosing the composite computation and enumerating the returned fields, which it does. It also warns that exchange+symbol triggers an automatic live funding fetch, an implicit network dependency worth noting against openWorldHint=false, though this reads as a data-source detail rather than a contradiction of the read-only claim.

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?

It is front-loaded with what the tool produces, then when to use it, then the sibling to avoid, then the return keys. Five sentences with no filler, though the two trigger-phrase examples could be compressed into one.

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, listing the returned fields (positionSize, breakeven, liquidationPrice, fundingCost, overnightBreakevenShift, verdict) is genuinely necessary and is supplied. For a 15-parameter orchestration tool the coverage is close to complete, with only minor gaps around failure behavior when the live funding fetch fails or when exchange/symbol are omitted.

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% and the schema already documents the cross-field shortcut ("If omitted, fetched live from exchange"), so the description's note about supplying exchange+symbol largely restates structured data. With 15 parameters and only this one interaction surfaced, it does not add meaning beyond the schema; 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 names a specific verb and composite resource: it orchestrates position sizing, breakeven, liquidation, and funding cost into one decision card. It also explicitly contrasts itself with workflow.run_risk_reward, so an agent can distinguish the two without opening either schema in a 70-sibling namespace.

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 concrete trigger phrasings ("should I take this trade?", "run the numbers on this setup") and names the alternative (workflow.run_risk_reward) with the condition that selects it (an R:R-graded verdict on entry/stop/target). It even states the precondition for live funding lookup: supply exchange+symbol.

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.