Skip to main content
Glama

Agent Financial Advisor

Position sizing

position_size

Size a position the way a risk manager would: fixed-fractional risk to a stop, volatility targeting (ATR or annualized vol), or fractional Kelly from your edge statistics. Applies a max-position cap and round lots, and explains the binding constraint. Price: $0.005.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "equity": 50000,
      "method": "fixed_fractional",
      "risk_pct": 0.01,
      "stop_price": 95,
      "entry_price": 100
    },
    "name": "position_size"
  }
}

Input Schema

NameRequiredDescriptionDefault
atrNovolatility: average true range in price units.
sideNolong
equityYes
methodYes
api_keyNoOptional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial.
avg_winNokelly: average win (any unit, same as avg_loss).
avg_lossNokelly: average loss as a positive number.
lot_sizeNoRound down to this multiple, default 1.
risk_pctNofixed_fractional: fraction of equity to risk, default 0.01.
win_rateNokelly: probability of a win (0-1).
annual_volNovolatility: annualized volatility of the asset (e.g. 0.35).
stop_priceNoRequired when method is fixed_fractional: the protective stop price.
entry_priceYes
atr_multipleNovolatility: stop distance in ATRs, default 2.
kelly_fractionNokelly: fraction of full Kelly to use, default 0.25.
allow_fractionalNo
max_position_pctNoCap on position value / equity, default 0.2.
target_annual_vol_contributionNovolatility: target vol contribution as fraction of equity, default 0.02.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / stop_price / description
      Previous value: -"fixed_fractional: protective stop."New value: +"Required when method is fixed_fractional: the protective stop price."
  2. Changed1 schema field changed
    • addedInput schema / properties / api_key
      Added value: +{
      +  "description": "Optional. Your AFA API key (afa_...), from get_api_key. Pass it on every call so free calls and credits apply; without it calls use the anonymous trial.",
      +  "type": "string"
      +}
  3. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "entry_price": 100,
      +    "equity": 50000,
      +    "method": "fixed_fractional",
      +    "risk_pct": 0.01,
      +    "stop_price": 95
      +  }
      +]
  4. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden, and it does disclose real behavioral traits: a max-position cap is applied, sizes are rounded to lots, and the response explains which constraint bound the result. It also discloses the $0.005 cost. What it does not state is what happens on invalid method/parameter combinations or how errors surface, so it stops short of full coverage.

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?

Two tightly packed sentences front-load the purpose and method menu, then the cap/rounding/constraint behavior, with the price tacked on at the end. Every clause carries information; nothing is redundant with the title or schema.

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?

For an 18-parameter tool with no output schema and no annotations, the description should say more about the return shape — 'explains the binding constraint' hints at a narrative field but not whether a share count, dollar value, or both are returned. Method preconditions (e.g., stop_price being required for fixed_fractional) are left to the schema, which is acceptable, but the output side is thin.

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 72%, and the description adds genuine mapping value by tying parameter groups to methods — stop-based risk for fixed_fractional, ATR or annualized vol for volatility, edge statistics for Kelly — plus the cap and lot-rounding knobs. It doesn't clarify the remaining undocumented parameters (side, allow_fractional, entry_price), but the method-to-parameter grouping is real meaning beyond the schema.

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 verb+resource ('Size a position') and enumerates the three computational methods (fixed-fractional to a stop, volatility targeting via ATR or annualized vol, fractional Kelly). It also names the post-processing it performs (max-position cap, round lots) and the explained output (the binding constraint), which no sibling tool does, so an agent can distinguish it from pre_trade_check or options_risk_check without opening the schema.

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 phrasing 'the way a risk manager would' and the method list imply when to reach for it, but there is no explicit when-to-use vs. when-not, and no routing to siblings such as pre_trade_check or portfolio_review. The agent must infer that this is the sizing step of a workflow rather than a validation step.

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.