Skip to main content
Glama

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

Funding Breakeven

workflow.run_funding_breakeven
Read-only

Price move needed to cover funding cost + fees over a holding period. Edge cases: entry_price, size and hold_hours above zero; funding_rate is a decimal per funding interval (0.0001 is 0.01%), either sign; funding_interval_hours 0.25 to 24 (default 8); fees are fractions from 0 to 0.05. If carry cost exceeds what any price move can offset, the call is an error. Not covered: a funding rate that changes during the hold, mark versus last price, and slippage. Use when user asks "how much does BTC need to move for me to profit after funding?" or "is funding killing my edge on this trade?". Returns: breakevenWithFunding, breakevenWithoutFunding, requiredMovePct.

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>",
      "size": "<size>",
      "funding_rate": "<funding_rate>",
      "hold_hours": "<hold_hours>"
    },
    "name": "workflow.run_funding_breakeven"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideYesTrade direction: "long" or "short"
sizeYesPosition size in base currency
hold_hoursYesHold duration in hours
entry_priceYesEntry price
contractTypeNolinear = USDT-margined (default), inverse = coin-margined. size is USD notional (contracts) for inverse; notional/funding_cost/fee_total/total_carry_cost come back denominated in the base coin.
fee_open_pctNoOpen fee rate (default 0.0002)
funding_rateYesFunding rate per funding interval as a DECIMAL FRACTION, not a percent: 0.0001 means 0.01%, so a quoted 0.0125% is 0.000125
fee_close_pctNoClose fee rate (default 0.0005)
funding_interval_hoursNoHours per funding payment, the period funding_rate covers: 8 (default), 1 on Hyperliquid, dYdX, Kraken and Backpack (per-hour rates), 4 or 2 on some symbols of Binance, Bybit, OKX, Gate, KuCoin, MEXC, Aster and Phemex

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / funding_rate / description
      Previous value: -"Funding rate per funding interval (decimal, e.g. 0.0001)"New value: +"Funding rate per funding interval as a DECIMAL FRACTION, not a percent: 0.0001 means 0.01%, so a quoted 0.0125% is 0.000125"
  2. Changed4 schema fields changed
    • changedInput schema / properties / funding_interval_hours / description
      Previous value: -"Hours per funding payment: 8 (default) or 1 (Hyperliquid, dYdX and Kraken, whose rate is per hour)"New value: +"Hours per funding payment, the period funding_rate covers: 8 (default), 1 on Hyperliquid, dYdX, Kraken and Backpack (per-hour rates), 4 or 2 on some symbols of Binance, Bybit, OKX, Gate, KuCoin, MEXC, Aster and Phemex"
    • removedInput schema / properties / funding_interval_hours / enum
      Removed value: -[
      -  8,
      -  1
      -]
    • addedInput schema / properties / funding_interval_hours / maximum
      Added value: +24
    • addedInput schema / properties / funding_interval_hours / minimum
      Added value: +0.25
  3. Changed2 schema fields changed
    • addedInput schema / properties / funding_interval_hours
      Added value: +{
      +  "description": "Hours per funding payment: 8 (default) or 1 (Hyperliquid, dYdX and Kraken, whose rate is per hour)",
      +  "enum": [
      +    8,
      +    1
      +  ],
      +  "type": "number"
      +}
    • changedInput schema / properties / funding_rate / description
      Previous value: -"Funding rate per 8h period (decimal, e.g. 0.0001)"New value: +"Funding rate per funding interval (decimal, e.g. 0.0001)"
  4. Changed1 schema field changed
    • addedInput schema / properties / side / description
      Added value: +"Trade direction: \"long\" or \"short\""
  5. Changed1 schema field changed
    • addedInput schema / properties / contractType
      Added value: +{
      +  "description": "linear = USDT-margined (default), inverse = coin-margined. size is USD notional (contracts) for inverse; notional/funding_cost/fee_total/total_carry_cost come back denominated in the base coin.",
      +  "enum": [
      +    "linear",
      +    "inverse"
      +  ],
      +  "type": "string"
      +}
  6. Added

TDQS

A3.6/5.0
Behavior3/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 the safety profile is pre-covered. Beyond that the description adds genuine value: hard validity constraints, an explicit error condition when carry cost cannot be offset, and a list of modeling gaps. However it says nothing about units of the returned values or how the error surfaces, leaving the mutation-free behavior only partly characterized.

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 purpose is front-loaded in a single line, followed by constraints, exclusions and return fields in a logical progression. Some text is redundant with the schema (the decimal-fraction explanation for funding_rate is repeated almost verbatim). It remains dense and free of filler, so the repetition costs little.

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, but the description enumerates the three return fields, which compensates. For a nine-parameter quantitative tool it covers inputs, bounds, error behavior and known modeling limitations, which is most of what an agent needs. Units and sign conventions of the returned breakeven values are the main uncovered detail.

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 all nine parameters are already documented, and the description largely restates them (funding_rate as a decimal, funding_interval_hours default 8) rather than extending them. The one real addition is the fees range of 0 to 0.05 and the positive-value constraint on entry_price, size and hold_hours, which the schema does not state. Baseline 3 is appropriate given the schema does the heavy lifting.

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

Purpose4/5

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

The opening sentence gives a specific verb-and-resource: computes the price move required to cover funding cost plus fees over a holding period. It also names the three return fields, which separates it from a pure funding-cost calculator. It never names or contrasts a sibling though, so an agent must infer the boundary with run_funding_cost or run_breakeven_planning on its own.

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 supplies two concrete triggering user questions ("how much does BTC need to move for me to profit after funding?" and "is funding killing my edge?"), which gives the agent a clear situational cue. It also states explicit scope exclusions (variable funding rate, mark vs last, slippage). It stops short of naming an alternative tool for those out-of-scope cases.

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.