Skip to main content
Glama
leverra-mcp

leverra-mcp

Official
by leverra-labs

Position size from risk

position_size
Read-onlyIdempotent

Calculate the trade size that risks exactly a set percentage of an account when the stop is hit; returns units, notional, dollar risk, implied leverage, and side.

Instructions

How big a position is so that hitting the stop loses exactly risk_pct of the account. Returns size in units, notional, the dollar risk, the leverage it implies and the side (stop below entry = long). Fees and slippage not included. Offline.

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": {
      "account": "<account>",
      "risk_pct": "<risk_pct>",
      "entry": "<entry>",
      "stop": "<stop>"
    },
    "name": "position_size"
  }
}

Input Schema

NameRequiredDescriptionDefault
stopYes
entryYes
accountYesAccount size, USD.
risk_pctYesRisk per trade, % of account.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, closed-world, non-destructive, so the added value is in the semantics: which return fields come back, the rule that stop below entry means long, and the explicit caveat that fees and slippage are excluded. 'Offline' restates openWorldHint=false but usefully reinforces it.

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?

Four short sentences with no filler: the core computation first, then return values, then the fee/slippage caveat, then the offline note. Every sentence carries distinct 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?

With no output schema, the definition still enumerates what is returned, flags what is not modeled (fees, slippage), and explains the side derivation. For a four-required-parameter pure calculator, nothing an agent needs to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 50% (entry and stop carry no descriptions), but the description compensates by establishing that stop is the stop price, entry the entry price, and that their relative ordering determines the reported side. risk_pct and account are aligned with the schema rather than expanded on.

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 precise computation: the position size at which hitting the stop loses exactly risk_pct of the account. The resource and output ('size in units, notional, dollar risk, leverage, side') are named, and it is unmistakably distinct from siblings such as liquidation_price or funding_spreads.

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 framing (risk-based position sizing when a stop is defined), but the description never says when to reach for this versus liquidation_price or other calculators, and it states no prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.