Skip to main content
Glama

Liquidation price calculator

liquidation_price
Read-only

Liquidation price calculator for a leveraged perpetual-futures position (isolated margin, linear contracts): liquidation price, how far the price can move before it, margin and notional, and the funding cost per day at a funding rate you give. Arithmetic, not advice. US$0.002 per call; 3 free calls a day.

Input Schema

NameRequiredDescriptionDefault
sideYesPosition side.
entryYesEntry price.
leverageYes1-200.
size_usdNoPosition notional in US dollars (default 1000).
funding_hourlyNoOptional hourly funding rate, e.g. 0.0000125, for the daily funding cost.

Output Schema

NameRequiredDescriptionDefault
paidNo
sideNo
entryNo
trialNo
messageNo
leverageNo
margin_usdNo
notional_usdNo
pay_per_callNo
liquidation_priceNo
funding_per_day_usdNo
funding_rate_hourlyNo
move_to_liquidation_pctNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedInput schema / properties / coin
      Removed value: -{
      -  "description": "Optional symbol to use its latest recorded funding rate.",
      -  "type": "string"
      -}
    • addedInput schema / properties / funding_hourly
      Added value: +{
      +  "description": "Optional hourly funding rate, e.g. 0.0000125, for the daily funding cost.",
      +  "type": "number"
      +}
  2. Added

TDQS

A4/5.0
Behavior4/5

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

Annotations already establish readOnly/destructive/openWorld, so the description's job is otherwise; it delivers real additional context: per-call cost of US$0.002, a 3-free-calls-per-day quota, and the 'arithmetic, not advice' disclaimer that sets expectations about output. It lacks any note on precision, rounding, or what happens at extreme leverage, but the cost and quota disclosure is genuinely useful to an agent budgeting calls.

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 front-loaded sentence that opens with what is computed and closes with cost and quota; the parenthetical contract qualifiers are dense but necessary. Slightly list-like in the middle, but nothing is wasted.

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?

An output schema exists so return values need not be explained, the input schema fully covers all five parameters, and the description supplies the missing commercial context (price, free tier) plus the contract-type constraint. Nothing an agent needs to invoke it correctly is absent.

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 the baseline is 3 and the schema already documents side, entry, leverage, size_usd default, and the funding_hourly example format. The description only adds that the funding rate you supply is used to derive a daily funding cost, which clarifies intent but not parameter syntax beyond the schema.

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?

Names a specific computation (liquidation price) scoped to a precise instrument class (leveraged perpetual futures, isolated margin, linear contracts), and enumerates outputs: liquidation price, distance to it, margin, notional, and daily funding cost. An agent can immediately distinguish this from generic price tools like crypto_prices.

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 instrument scope (isolated margin, linear contracts) implicitly tells the agent when the result is valid, and the pricing line gives a cost consideration for calling it. But there is no explicit when-to-use/when-not guidance and no named alternative among the 40+ siblings that cover market data.

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.

Resources