Skip to main content
Glama

Position Sizing

risk_position_size
Read-only

Fixed-fractional position sizing — a local calculation, not a data-provider lookup. Given account_size, risk_percent, entry and stop, returns position size in units, notional, implied leverage, stop distance, and — if a target is given — the reward:risk ratio. Direction (long/short) is inferred from the stop's side of entry. Deterministic: same inputs always give the same result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stopYesStop-loss price (below entry = long, above = short)
entryYesPlanned entry price
targetNoOptional take-profit price, used only to report reward:risk
account_sizeYesTotal account equity in USD
risk_percentYesPercent of the account to risk if the stop is hit, e.g. 1 for 1%

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
warningsNo
directionYeslong or short, inferred from the stop's side of entry
riskAmountUsdYesRisk budget, USD
riskPerUnitUsdNoRisk per unit (|entry-stop|), USD
impliedLeverageNoNotional / account equity as a multiple (3.5 = 3.5x)
rewardRiskRatioNoReward:risk ratio; omitted when no target was given
stopDistancePctNoStop distance from entry in percentage points
positionSizeUnitsYesPosition size in base-asset units
positionNotionalUsdYesPosition notional, USD

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses determinism ('same inputs always give the same result'), the inference of direction from the stop's side of entry, the local nature of the computation, and how the optional target only affects reward:risk. These are behavioral traits that materially affect how an agent interprets results and call semantics, all provided in the description.

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?

Three sentences, each earning its place: identity and scope, inputs and outputs, then deterministic behavior and direction inference. The most important differentiator ('not a data-provider lookup') is front-loaded. No redundant phrasing or filler.

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 5-parameter calculation tool with an output schema, the description covers the return values, the optional parameter's purpose, the direction inference rule, and the deterministic nature. Nothing essential for correct invocation or interpretation is missing.

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 each parameter's meaning and units. The description reinforces the inputs but adds little beyond stating that target is used 'only to report reward:risk' and direction is inferred from stop placement. Baseline 3 is appropriate since schema carries the parameter burden and the description adds marginal context.

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 opens with 'Fixed-fractional position sizing' and immediately frames it as 'a local calculation, not a data-provider lookup,' which clearly distinguishes it from the sibling data tools. It names specific outputs (units, notional, implied leverage, stop distance, reward:risk) and the direction inference rule, so an agent knows exactly what this tool does and how it differs from siblings.

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?

The phrase 'a local calculation, not a data-provider lookup' gives an explicit when-not signal: don't use this to fetch external data. The input/output listing implies when to use it (when sizing a position from account size, risk, entry, stop), but no alternative tool is named or a conditional selection guide provided. Context is clear, exclusions are implicit rather than explicit.

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.

TDQS

A4/5.0
Disambiguation4/5

Tools are grouped by clear prefixes and mostly target distinct resources; market_quotes vs research_token_view, market_top_movers vs market_trending, and funding_current vs market_quotes have some field or purpose overlap, but descriptions draw enough scope boundaries for an agent to choose correctly in most cases. No two tools are truly interchangeable.

Naming Consistency5/5

All 30 tool names use lowercase snake_case with a consistent domain-prefix convention such as market_, flow_, research_, sentiment_, and catalysts_, making the surface predictable. Even helpers like utc_time and risk_position_size fit the same noun-oriented pattern without style mixing.

Tool Count2/5

At 30 tools this set crosses the 'too many' threshold, and several tools reproduce data already available through broader ones such as research_token_view and market_quotes. The breadth is defensible for a crypto-research platform, but the surface feels heavy and could be consolidated.

Completeness5/5

The tool set covers the read-only crypto research workflow thoroughly: market data, candles, derivatives, funding, OI, order book, whale flows, ETF flows, on-chain metrics, news, sentiment, prediction odds, technicals, regime/positioning scans, and position sizing. It also includes health and UTC helpers that close practical workflow gaps, with no obvious dead ends.

Resources