Skip to main content
Glama

TradingCalc MCP — Crypto Futures Math

workflow.run_funding_cost

Calculate the total funding cost (or income) for holding a perpetual futures position. Use when user asks "how much funding will I pay holding X days?" or "is funding eating my profit?". Returns: totalFundingUsdt (negative = you pay, positive = you receive), perIntervalUsdt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysYesNumber of days to hold
sideYes
sizeBaseYesPosition size in base asset
entryPriceYesEntry price
fundingRateYesFunding rate per 8h period as fraction, e.g. 0.0001
contractTypeNolinear = USDT-margined (default), inverse = coin-margined. For inverse, sizeBase is USD contracts and cost figures come out in the base coin.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / contractType
      Added value: +{
      +  "description": "linear = USDT-margined (default), inverse = coin-margined. For inverse, sizeBase is USD contracts and cost figures come out in the base coin.",
      +  "enum": [
      +    "linear",
      +    "inverse"
      +  ],
      +  "type": "string"
      +}
  2. Added

TDQS

A4/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the return values and the sign convention (negative = you pay, positive = you receive), which is valuable. However, it does not disclose assumptions such as a constant funding rate, no compounding, or the frequency of payments (3x per day) beyond what the schema already states. It also leaves 'perIntervalUsdt' undefined regarding which interval it refers to. These gaps mean the behavior is only partially transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences: the first states the purpose, the second gives usage triggers and return value semantics. It is concise, front-loaded, and every sentence earns its place. There is no fluff or repetition of schema details.

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?

For a calculation tool with 6 parameters and no output schema, the description provides the essential return values and sign convention, which is a significant part of what an agent needs. However, it lacks details on the calculation formula, assumptions (e.g., constant rate), and the meaning of 'perIntervalUsdt' (interval length). These are minor for a calculator but would make it more complete. Given the absence of an output schema, the description does a good job but has room to clarify the interval and assumptions.

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?

The schema already provides descriptions for most parameters (coverage 83%), and the description adds no extra meaning about the parameters themselves. It only mentions the return values, not the inputs. Since schema coverage is high, the baseline is 3, and the description does not go beyond that baseline.

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 clearly states the tool calculates total funding cost (or income) for holding a perpetual futures position, with a specific verb and resource. It also provides example user queries ('how much funding will I pay holding X days?') that make the purpose unmistakable. While it doesn't explicitly differentiate from siblings, the specificity of the scope (holding cost over days) is enough to distinguish it from tools like funding_arbitrage or funding_breakeven.

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?

The description gives explicit when-to-use triggers by quoting user intents ('how much funding will I pay...' or 'is funding eating my profit?'). However, it does not mention any when-not-to-use conditions or point to alternative sibling tools, so it falls short of the full 5 which requires exclusions or explicit alternatives.

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.