Skip to main content
Glama

PerpSpread — Cross-Exchange Perpetual Funding Arbitrage MCP

Calculate 4-Leg Position Rotation Breakeven

calculate_rotation_breakeven
Read-onlyIdempotent

Evaluate whether rotating from an existing funding-arb pair A into target symbol B pays back 4-leg fees, slippage, and exit/entry basis.

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": {
      "current_symbol": "<current_symbol>",
      "current_long": "<current_long>",
      "current_short": "<current_short>",
      "target_symbol": "<target_symbol>"
    },
    "name": "calculate_rotation_breakeven"
  }
}

Input Schema

NameRequiredDescriptionDefault
executionNoOrder execution type (default taker).
okx_rebateNoApply optional OKX 20% new-user fee rebate (default false; Standard VIP 0 baseline).
capital_usdNoTotal 1x delta-neutral capital in USD (default 20000).
current_longYesCurrently held long exchange id.
current_shortYesCurrently held short exchange id.
target_symbolYesTarget coin ticker to rotate into.
current_symbolYesCurrently held coin ticker.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds genuine value by enumerating what the computation accounts for — all four legs' fees, slippage, and entry/exit basis — which tells the agent this is a net-cost model rather than a naive fee comparison. It does not disclose the shape of the returned evaluation, which keeps it below 5.

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?

A single tightly packed sentence with the key concept (rotation payback) front-loaded and no filler. It is slightly dense with domain jargon such as '4-leg' and 'exit/entry basis' that is never unpacked, but nothing is redundant.

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

Completeness3/5

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

For a seven-parameter calculation tool with no output schema, the description covers the inputs' intent but leaves the return value underspecified — an agent cannot tell whether it receives a boolean, a breakeven threshold, or a cost breakdown. The cost-component enumeration is helpful, but the result contract is a real gap for a decision tool.

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 seven parameters (including capital_usd, execution, and okx_rebate) are already documented in the schema, establishing a baseline of 3. The description adds only the aggregate framing of '4-leg' costs and does not clarify how capital_usd or the maker/taker choice alters the breakeven result beyond what the schema states.

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 description gives a specific verb+resource: it evaluates whether a rotation from funding-arb pair A into target symbol B pays back costs. It names the exact cost components (4-leg fees, slippage, entry/exit basis), which is far more informative than the title alone. It does not explicitly contrast with siblings like audit_orderbook_slippage or get_top_funding_spreads, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

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

The decision framing ('evaluate whether rotating ... pays back') implies this is a pre-trade comparison tool, but there is no explicit when-to-use/when-not-to-use guidance and no named alternative. An agent can infer usage but must reason about it rather than being told directly.

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.