Skip to main content
Glama

Liquidation price and stop check

liquidation_price
Read-onlyIdempotent

Calculates the liquidation price of an isolated-margin crypto futures position (long or short) from entry price and leverage, the distance to it, and, if a stop-loss is given, whether liquidation would come before the stop and the highest leverage the stop allows. Pure calculation, no market data.

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

Input Schema

NameRequiredDescriptionDefault
sideYesPosition direction: long (profits when price rises) or short (profits when price falls).
stopNoOptional stop-loss price. If given, the answer says whether liquidation comes before the stop.
entryYesEntry price of the position, in the quote currency (e.g. USD).
leverageYesLeverage multiple, e.g. 10 for 10x. Isolated margin is assumed.
maintenance_margin_pctNoMaintenance margin in percent. Default 0.5.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / entry / description
      Previous value: -"Entry price."New value: +"Entry price of the position, in the quote currency (e.g. USD)."
    • addedInput schema / properties / leverage / description
      Added value: +"Leverage multiple, e.g. 10 for 10x. Isolated margin is assumed."
    • addedInput schema / properties / side / description
      Added value: +"Position direction: long (profits when price rises) or short (profits when price falls)."
    • changedInput schema / properties / stop / description
      Previous value: -"Optional stop-loss price."New value: +"Optional stop-loss price. If given, the answer says whether liquidation comes before the stop."
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

The annotations already establish that this is a read-only, idempotent, non-destructive, closed-world calculation. The description adds meaningful behavioral context by stating it is a pure calculation with no market data and by clarifying the optional stop-loss comparison and maximum allowable leverage. It does not describe exact return shape, but no output schema exists, so this remains a minor gap.

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?

The description is front-loaded with the main calculation and is free of filler. It is a single dense sentence with parentheticals, which is efficient but slightly less scannable than a short structured breakdown. Overall it remains concise and purposeful.

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 five-parameter calculation tool with no output schema, the description covers the essential inputs, the optional stop-loss behavior, the isolated-margin assumption, and the absence of market data. It indicates the kinds of results returned, such as distance to liquidation and whether liquidation precedes the stop. It stops short of describing the full return format or edge cases, which keeps it from being fully complete.

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 schema already documents all five parameters, including maintenance_margin_pct. The description adds conceptual meaning for entry price, leverage, and the optional stop-loss, but it does not explain every parameter or add format details beyond the schema. A baseline 3 is appropriate because the schema carries most of the parameter semantics.

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 states a specific verb and resource: calculating the liquidation price of an isolated-margin crypto futures position from entry price and leverage. It also clarifies the scope with 'pure calculation, no market data,' which helps distinguish it from market-data workflows. The optional stop-loss behavior and the long/short position scope make the purpose unambiguous.

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 clear context for when the tool applies: isolated-margin crypto futures positions, with optional stop-loss checks. It does not explicitly name alternatives such as leverage_survival or position_size, nor does it state exclusions. Still, the calculation-only scope provides useful usage guidance without being misleading.

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.