Skip to main content
Glama

Size a position from risk

position_size

Calculate position size from account equity, risk percentage, and stop distance, rejecting inputs that over-leverage or use a zero stop.

Instructions

Turns account equity, risk tolerance and a stop distance into a position size. Refuses inputs that would risk more than the account or imply a zero stop.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stopYes
entryYes
equityYes
riskPercentYes
contractSizeNoUnits per contract. Defaults to 1.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool refuses inputs that risk more than the account or imply a zero stop, which is useful behavioral context. However, it does not mention whether the tool is read-only, what the output format is, or how it handles errors beyond refusal. For a calculation tool with no annotations, this is a moderate gap.

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?

The description is two sentences with no fluff. The primary purpose is stated first, followed by a key behavioral constraint. Every word earns its place, and the structure is optimal for quick comprehension.

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

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 5 parameters, no output schema, and no annotations, the description is incomplete. It does not explain what the tool returns (e.g., position size in shares or lots), nor does it mention contractSize or the role of entry price. The refusal behavior is disclosed, but other essential usage details are missing. The description is not sufficient for an agent to fully understand the tool's behavior and output.

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 only 20% (only contractSize has a description). The tool description maps the main inputs (equity, risk tolerance, stop distance) to the calculation purpose, providing some semantic context. However, it omits entry and contractSize, and does not explain the relationship between parameters or the output units. It adds some value but does not fully compensate for the low schema coverage.

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: it turns account equity, risk tolerance, and a stop distance into a position size. This clearly distinguishes it from sibling tools like list_symbols, backtest, get_ohlc, and indicator, which are about data retrieval or backtesting. The purpose is unambiguous and not a tautology.

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?

The description implies when to use the tool (when you need to compute a position size from risk parameters), but it does not explicitly mention alternatives or when not to use it. No exclusions are stated, and the context is clear enough that an agent could infer usage, but the guidance is not explicit.

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

Deploy Server

Other Tools