Skip to main content
Glama

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

Carry Trade

workflow.run_carry_trade
Read-only

Delta-neutral carry trade (funding arbitrage) analysis, with a profitable/marginal/loss verdict on top of the same math primitive.funding_arb uses. Compared with primitive.funding_arb, this one adds output for the case where a plain-English verdict is wanted, not just the raw numbers. Edge cases: notional and hold_days above zero; funding_rate_long and funding_rate_short are in PERCENT per interval (0.01 means 0.01%), either sign; transfer_fee_pct 0 or more, one way (default 0.1); interval_hours 0.25 to 24 (default 8), one interval for both legs. Not covered: price divergence between the two venues, liquidation of either leg, margin needed on both venues, rates that change during the hold, and withdrawal limits; the result assumes the rates stay as given. Use when user asks "is this carry trade worth it?": long on exchange A, short on exchange B, collect the funding rate spread. Returns: netYieldPct, grossProfit, netProfit, breakevenDays, verdict (profitable/marginal/loss).

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": {
      "notional": "<notional>",
      "funding_rate_long": "<funding_rate_long>",
      "funding_rate_short": "<funding_rate_short>",
      "hold_days": "<hold_days>"
    },
    "name": "workflow.run_carry_trade"
  }
}

Input Schema

NameRequiredDescriptionDefault
notionalYesPosition notional in USDT
hold_daysYesHold duration in days
interval_hoursNoHours between funding payments, one interval for both legs (default 8; 1 for hourly venues; 4 or 2 on some symbols). A leg paid on another interval is entered as its rate times (this interval / its own interval).
transfer_fee_pctNoOne-way transfer fee % (default 0.1)
funding_rate_longYesFunding rate on the long exchange per interval, in percent (0.01 means 0.01%, not 0.0001)
funding_rate_shortYesFunding rate on the short exchange per interval, in percent (0.01 means 0.01%, not 0.0001)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / funding_rate_long / description
      Previous value: -"Funding rate on long exchange per interval (decimal)"New value: +"Funding rate on the long exchange per interval, in percent (0.01 means 0.01%, not 0.0001)"
    • changedInput schema / properties / funding_rate_short / description
      Previous value: -"Funding rate on short exchange per interval (decimal)"New value: +"Funding rate on the short exchange per interval, in percent (0.01 means 0.01%, not 0.0001)"
  2. Changed4 schema fields changed
    • changedInput schema / properties / interval_hours / description
      Previous value: -"Funding interval: 1 or 8 hours (default 8)"New value: +"Hours between funding payments, one interval for both legs (default 8; 1 for hourly venues; 4 or 2 on some symbols). A leg paid on another interval is entered as its rate times (this interval / its own interval)."
    • removedInput schema / properties / interval_hours / enum
      Removed value: -[
      -  1,
      -  8
      -]
    • addedInput schema / properties / interval_hours / maximum
      Added value: +24
    • addedInput schema / properties / interval_hours / minimum
      Added value: +0.25
  3. Added

TDQS

A4.4/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 and the description is free to spend its words on the model's assumptions. It does that well: it discloses that the result assumes rates stay as given and enumerates the unmodeled risks (price divergence, liquidation, margin on both venues, rate changes, withdrawal limits). A small deduction because several 'Edge case' sentences restate schema constraints (percent units, interval ranges, defaults) rather than adding 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?

Purpose and the sibling comparison are front-loaded, and the edge-case/not-covered/returns blocks are clearly delimited. The phrasing is occasionally convoluted ('on top of the same math primitive.funding_arb uses') and some sentences are redundant with the schema, but almost every line earns its place for a calculation tool with real modeling assumptions.

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?

No output schema exists, and the description compensates by naming the returned fields (netYieldPct, grossProfit, netProfit, breakevenDays, verdict) and the verdict's three possible values. Combined with the stated assumptions and exclusions, an agent has everything needed to call it correctly and to caveat the answer to a user.

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?

With 100% schema description coverage and only six flat numeric parameters, the schema already carries units, defaults, bounds and the interval-conversion note. The description's parameter guidance (percent per interval, 0.01 means 0.01%, transfer_fee_pct one way, interval_hours 0.25-24) largely repeats the schema verbatim, so the baseline 3 applies with little value added beyond emphasis.

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 and resource ('Delta-neutral carry trade (funding arbitrage) analysis') and explicitly differentiates itself from a near-twin ('Compared with primitive.funding_arb, this one adds output for the case where a plain-English verdict is wanted'). The construction 'long on exchange A, short on exchange B, collect the funding rate spread' removes any ambiguity about what is being computed. The only nit is that the referenced sibling is named as 'primitive.funding_arb' while the sibling list shows 'workflow.run_funding_arbitrage', but the intent remains legible.

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?

Gives an explicit trigger ('Use when user asks "is this carry trade worth it?"'), an explicit alternative with the condition that selects it (plain numbers vs. verdict), and an explicit 'Not covered' list that tells the agent when the answer would be out of scope. This is the rare case where when-to-use, when-not-to-use, and the alternative are all present.

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.