Skip to main content
Glama

perps liquidation price

perps_liquidation_price
Read-only

Liquidation price for a leveraged perp position: from entry, leverage, side and the maintenance margin rate, get the liquidation level, how far away it is in percent, margin posted and the loss at liquidation, plus a table of the same position at 2x to 100x. Add extra_margin to see how topping up moves it. Isolated margin, USD-margined contracts (Hyperliquid, Binance, Bybit, dYdX style). $0.002. Costs $0.002 USDC per call (x402).

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": {
      "entry": "<entry>",
      "leverage": "<leverage>"
    },
    "name": "perps_liquidation_price"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideNolong (default) or short
sizeNounits, default 1
entryYes
leverageYes
extra_marginNoadded collateral in USD
maintenance_margin_percentNodefault 0.5

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so safety is covered; the description adds behavior the agent cannot get from structured fields, notably the paid-call model ("Costs $0.002 USDC per call (x402)") and a concrete inventory of what the response contains. It does not mention rate limits, failure modes for invalid leverage, or latency, which keeps it from a 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?

Front-loaded with the purpose and input/output summary in one dense sentence, followed by scoping and payment notes. The only waste is the duplicated price ("$0.002. Costs $0.002 USDC per call (x402)"), which repeats the same fact twice.

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?

With no output schema, the description properly compensates by listing the return values, and it discloses the cost model and contract scope for a tool that implies a paid external computation. What remains missing is edge-case behavior (e.g. what happens when liquidation price exceeds entry, or unsupported leverage values), which is minor for a pure calculator.

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 coverage is 67%, above the floor but not complete, so the description must carry some weight. It does add meaning for extra_margin ("how topping up moves it") and frames which inputs drive the result, but says nothing about size/units beyond the schema's own note and nothing about acceptable leverage ranges or the maintenance margin default of 0.5.

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?

"Liquidation price for a leveraged perp position" names a specific computed quantity and resource, and the sentence enumerates the inputs (entry, leverage, side, maintenance margin rate) and outputs (liquidation level, distance in percent, margin posted, loss at liquidation). It is clearly distinct from price-feed siblings like crypto_price or oracle_price, though it never names the sibling it should be paired with (e.g. perps_positions).

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?

"Isolated margin, USD-margined contracts (Hyperliquid, Binance, Bybit, dYdX style)" gives an explicit applicability boundary, and "Add extra_margin to see how topping up moves it" tells the agent when to use an optional parameter. It stops short of stating when NOT to use it (e.g. cross-margin or coin-margined positions) or naming alternatives, so not a 5.

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