Skip to main content
Glama

Leverage survival

leverage_survival
Read-onlyIdempotent

What a leveraged trade actually did, opened on every single day of the history instead of the one day that worked. Give coin, side, leverage and holding period: you get the share of those days that ended liquidated, the median outcome, the best day, and what the same coin did with no leverage at all. Real perpetual tape, with the funding that was actually paid charged daily and eating into margin. Coins that blew up included.

Use when the question involves leverage, perpetuals or liquidation. For the fall an unleveraged holder sits through use drawdown_check; for two or three coins at once, coin_comparison.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYesTicker or full pair. An unknown one comes back with the list we hold and the ones we do not.
daysYesHow long it is held: 1, 7, 30 or 90.
sideNolong or short. Defaults to long.long
leverageYes2, 3, 5, 10, 20, 25, 50 or 100.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okNofalse when we do not hold that data. Never a zero standing in for an answer.
errorNono_data when ok is false.
modelNoThe assumptions, stated: liquidation at exactly 1/leverage with no maintenance margin, funding charged daily, the wick decides not the close.
reasonNoWhy, in one sentence, and what we do have instead.
sourceNoThe public file these numbers come from.
attemptsNoStarting days tested. A position still open when the history ends is not counted.
best_pctNoThe best day. It is the one you were shown, and it is not hidden here.
try_insteadNoWhen ok is false: the closest call that does answer, ready to send (tool, arguments, and what changed).
same_coin_inNoWhen ok is false because this tool lacks the coin: the other tools that hold it, each with arguments ready to send.
liquidated_pctNoShare of them that ended with nothing left.
median_return_pctNoThe middle outcome, on the margin.
median_days_to_liquidationNoHow fast, when it happened.
median_return_unlevered_pctNoWhat the same coin did with no leverage over the same days. A result without this is advertising.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "coin": "BTC",
      +    "days": 30,
      +    "leverage": 25
      +  }
      +]
    • addedOutput schema / properties / same_coin_in
      Added value: +{
      +  "description": "When ok is false because this tool lacks the coin: the other tools that hold it, each with arguments ready to send.",
      +  "type": "array"
      +}
    • addedOutput schema / properties / try_instead
      Added value: +{
      +  "description": "When ok is false: the closest call that does answer, ready to send (tool, arguments, and what changed).",
      +  "type": "object"
      +}
  2. Changed4 schema fields changed
    • addedInput schema / properties / days / enum
      Added value: +[
      +  1,
      +  7,
      +  30,
      +  90
      +]
    • addedInput schema / properties / leverage / enum
      Added value: +[
      +  2,
      +  3,
      +  5,
      +  10,
      +  20,
      +  25,
      +  50,
      +  100
      +]
    • addedInput schema / properties / side / default
      Added value: +"long"
    • addedInput schema / properties / side / enum
      Added value: +[
      +  "long",
      +  "short"
      +]
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover safety (readOnly, non-destructive, idempotent, closed-world), but the description adds behavioral substance an annotation cannot: funding actually paid is charged daily and eats into margin, the tape is real perpetual data, and delisted/blown-up coins are retained rather than dropped. It also enumerates the returned statistics, so the agent knows the shape of the answer.

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 and organized as purpose-then-routing, with the alternative tools last. It is slightly longer than needed in the opening clause ('instead of the one day that worked'), but every sentence still carries information.

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?

For a read-only analytics tool with an output schema, the description covers everything an agent needs: data source, cost assumptions, universe handling (delisted coins), the metrics returned, and the sibling routing. Return values need not be re-explained because an output schema exists.

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% and three of four parameters carry enums, so the schema already documents syntax and allowed values. The description only restates the four inputs ('give coin, side, leverage and holding period') without adding units, defaults, or interpretation beyond what the schema says. Baseline 3 is correct here.

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 exactly what is computed: a leveraged trade opened on every historical day, returning liquidation share, median outcome, best day, and the unleveraged comparison. It names the data source (real perpetual tape) and scope (coins that blew up included), which an agent can use to distinguish it from drawdown_check or coin_comparison without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit routing: 'Use when the question involves leverage, perpetuals or liquidation,' plus two named alternatives with the condition that selects each ('the fall an unleveraged holder sits through' -> drawdown_check; 'two or three coins at once' -> coin_comparison). Nothing is left to inference.

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