Skip to main content
Glama

DeFAI Intent Solver, Yield Optimizer & Kelly Execution Router MCP

Calculate Perpetual Futures Isolated Liquidation Price & Averaging-Down (DCA)

calculate_perp_liquidation_and_dca
Read-onlyIdempotent

Computes exact isolated-margin liquidation price, distance to liquidation %, averaged entry after DCA/extra margin, and maker vs taker fee drag.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "calculate_perp_liquidation_and_dca"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideNo'long' or 'short'
dcaPriceNoOptional second entry price for averaging down/up
leverageNoLeverage multiplier (1 to 125)
entryPriceNoEntry price (e.g. 95000)
marginUsdtNoInitial isolated margin in USDT
dcaMarginUsdtNoOptional margin allocated to second entry
extraMarginUsdtNoOptional extra collateral added without increasing size

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=true, so the safety profile is covered without description help. The description adds the return-value surface, which is genuinely useful, but it omits notable behavior: all 7 parameters are optional yet nothing says which are effectively required, what defaults apply, or what the tool returns when entryPrice/margin are absent. No annotation contradiction.

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?

A single sentence that front-loads the primary computation and then enumerates the secondary outputs in the order an agent would care about them. No filler, no restatement of the tool name.

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 carries the burden of explaining return values and does so explicitly, which is the right call for a 7-parameter calculator. The remaining gap is that it never clarifies the all-optional parameter set or the interaction between marginUsdt, dcaMarginUsdt and extraMarginUsdt, which matters for correct invocation.

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 every parameter is already documented in structured form, which sets the baseline at 3. The description reinforces the domain framing (averaging down, extra collateral without increasing size) but adds no syntax, units, or constraint detail beyond what the schema already states.

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?

States a specific computation ('isolated-margin liquidation price') plus three named derivative outputs (distance to liquidation %, averaged entry after DCA, maker vs taker fee drag), so the agent knows exactly what it gets back. The name and title are fully disambiguated from siblings like calculate_concentrated_lp_impermanent_loss or scan_perp_funding_spreads, which cover different analytics.

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?

Usage is implied by the resource (a perp position's liquidation math) but there is no explicit 'use this when' clause, no statement of preconditions, and no routing to or from alternatives. An agent can infer the context from the verb and inputs, but nothing in the text tells it when this tool is the wrong choice versus a funding or carry tool.

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.