Skip to main content
Glama

RiskReward Trading Calculators

Fee-aware position size

calculate_position_size
Read-onlyIdempotent

Calculate position quantity and notional for a linear crypto futures trade from user-specified account balance, risk percentage, entry and stop. Includes separate entry/stop fees and optional target profit and net R. Direction is derived. Use when asked how much to buy or sell for a specified risk budget. Ask for missing prices or risk preference; do not invent them. Does not calculate liquidation, leverage, inverse contracts, exchange lot rounding, signals, or execute orders.

Input Schema

NameRequiredDescriptionDefault
feesNoUser-supplied rates. Omission explicitly assumes zero fees; no exchange rate lookup is performed.
stopPriceYesPlanned stop price. Direction is derived from entry and stop.
entryPriceYesPlanned entry price in quote currency per base unit.
riskPercentYesUser-chosen account risk percentage, e.g. 1 means 1%. Never infer a risk preference.
targetPriceNoOptional profit target, opposite the stop relative to entry.
quoteCurrencyNoCurrency shared by all monetary inputs. Defaults to USD; no currency conversion is performed.
accountBalanceYesAccount balance in the same quote currency as prices.
instrumentTypeNoLinear quote-margined instruments only. Inverse contracts and liquidation are unsupported.

Output Schema

NameRequiredDescriptionDefault
toolYes
inputsYes
metricsYes
formulasYes
warningsYes
assumptionsYes
reproduceUrlYes
documentationUrlYes
calculationVersionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description adds real behavioral context beyond them: omitted fees mean zero fees with no exchange lookup, direction is derived from entry/stop, no lot rounding, no inverse/liquidation support, and a do-not-invent policy for prices and risk. This is rich disclosure of scope limits and input defaults.

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?

Front-loaded with what is calculated and from what inputs, then usage, then exclusions. Every sentence carries a distinct constraint; no filler or redundancy across purposes.

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?

An output schema exists, so return values needn't be explained, and the schema fully documents inputs. Combined with the description's scope limits, usage trigger, and input policy, an agent has everything needed to invoke it correctly.

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 the schema already documents all 8 parameters, including fee percentages, defaults, and 'never infer a risk preference'. The description mainly restates those same facts ('direction is derived', 'do not invent' risk), adding little semantics beyond the structured fields, so baseline 3 applies.

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?

States a specific verb and resource: computing position quantity and notional for a linear futures trade from balance, risk %, entry and stop. The trigger 'how much to buy or sell for a specified risk budget' is clear. However, it never names or contrasts with the sibling calculate_net_risk_reward, and it advertises a 'net R' output that could be conflated with that sibling.

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

Usage Guidelines4/5

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

Gives an explicit when ('asked how much to buy or sell for a specified risk budget') and an explicit when-not list (no liquidation, leverage, inverse contracts, lot rounding, signals, order execution). It also directs the agent to ask for missing inputs rather than infer them. Alternatives are not routed to explicitly, so sibling differentiation is missing.

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