Skip to main content
Glama

leverage calc

leverage-calc
Read-onlyIdempotent

Max safe leverage for a perp trade: liquidation >=1.5x beyond stop (never off), costs vs move, risk per trade, measured survival cap, exchange limit -> min with the binding constraint named Price: $0.05 per call, USDC on Base via 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": {
      "symbol": "<symbol>",
      "equity": "<equity>",
      "entry": "<entry>",
      "stop_loss": "<stop_loss>"
    },
    "name": "leverage-calc"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNooptional: preserve (default) | target
entryYesnumber
equityYesnumber (USD)
symbolYesstring, e.g. ETHUSDT
stop_lossYesnumber
take_profitNonumber (optional)
risk_per_tradeNonumber (optional, fraction, default 0.02)
exchange_max_leverageNonumber (optional)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.3/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, openWorld), and the description adds substantial context beyond that: the liquidation buffer rule, that costs are weighed against the move, a survival cap, and that the result is the minimum of the survival cap and exchange limit with the binding constraint named. It also discloses commercial behavior that annotations cannot — $0.05 per call, USDC on Base via x402 — which matters before invoking an open-world paid tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is short and front-loads the purpose, then ends with pricing, which is reasonable ordering. However, the telegraphic fragments, colon-arrow notation, and unpunctuated clauses ('costs vs move, risk per trade, measured survival cap') make it harder to parse than a plain sentence would be; terseness here costs clarity rather than saving space.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/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 must carry the return contract, and it only partially does — it implies a leverage number plus a named binding constraint, but not the shape, units, or whether intermediate values (liquidation price, cost estimate) come back. For an 8-parameter paid calculation tool it covers the inputs and the decision logic, but leaves the response underspecified.

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 100%, so the schema already documents all eight parameters and their defaults. The description adds relational meaning not in the schema — that stop_loss drives the 1.5x liquidation buffer and that exchange_max_leverage participates in a min() — but it does not clarify ambiguous fields such as 'mode: preserve | target' or what 'measured survival cap' means numerically.

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?

The description names the resource and the computed quantity precisely: 'Max safe leverage for a perp trade', with the inputs it depends on (stop, costs, risk per trade, exchange limit). It is clearly distinguishable from every sibling (none are leverage calculators), though it opens with a noun phrase rather than a verb, which makes it read more like a spec fragment than a statement of action.

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

Usage Guidelines2/5

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

It establishes the domain ('for a perp trade') and implies a stop must exist ('liquidation >=1.5x beyond stop (never off)'), but never says when to reach for this tool versus the wallet/risk/token-check siblings, nor when it is inappropriate (e.g., spot trades, no stop defined). An agent must infer the calling context entirely from the required parameters.

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