Skip to main content
Glama

Explain Sizing

warden.explain_sizing
Read-onlyIdempotent

Explains position sizing by mirroring the risk engine's ATR, notional cap, gap and weekend rules, and reports house floors plus deviations from per-fund overrides.

Instructions

Step-by-step mirror of the live C# risk engine sizing: ATR sizing, position-notional cap, overnight-gap halving, weekend gross headroom. Reports the house floors and any deviation when per-fund overrides are supplied.

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": {
      "equity": "<equity>",
      "atr_14": "<atr_14>",
      "close": "<close>"
    },
    "name": "warden.explain_sizing"
  }
}

Input Schema

NameRequiredDescriptionDefault
closeYesCurrent close/reference price.
atr_14Yes14-bar average true range of the instrument.
equityYesAccount equity (base currency).
overnight_gapNoExpected overnight gap (price units); gaps above 1.2x ATR halve size.
gross_exposureNoCurrent portfolio gross exposure in currency.
floor_overridesNoOptional per-fund overrides; deviation from house floors is reported.
weekend_approachingNoTrue when the position would be held into the weekend (gross headroom applies).

Output Schema

NameRequiredDescriptionDefault
howNo
qtyNo
toolNo
errorNo
stepsNo
accessNo
safetyNo
reasonsNo
verdictNo
notionalNo
provenanceNo
trail_stopNo
house_floorsNo
request_access_atNo
overrides_deviationNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv1.2.1
    • removedOutput schema / properties / overrides_deviation / additionalProperties
      Removed value: -true
    • addedOutput schema / properties / overrides_deviation / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / overrides_deviation / type
      Removed value: -"object"
    • addedOutput schema / properties / trail_stop / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedOutput schema / properties / trail_stop / type
      Removed value: -"number"
  2. First observedv0.4.1

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so safety is covered; the description adds meaningful non-structured context that this mirrors the live C# production engine (i.e., outputs are authoritative, not approximate) and that house floors plus deviations are surfaced. It does not discuss units, error behavior on malformed overrides, or determinism beyond the idempotent hint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the core claim and then a compact colon-list of stages; no filler or hedging. Slightly dense noun-phrase stacking ('weekend gross headroom') is the only cost, so not quite a 5.

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

Completeness4/5

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

With an output schema present, the description needn't explain return values, and it covers the algorithm's shape, the override-deviation behavior, and the authoritative-engine aspect. Remaining gaps (units, override schema keyed to anyOf/additionalProperties, behavior when overrides are partial) are minor but real for a 7-parameter financial tool.

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 all seven parameters are already documented, including the 1.2x ATR overnight-gap threshold and the weekend gross-headroom flag. The description restates those same concepts at a high level ('overnight-gap halving', 'weekend gross headroom') without adding new semantics such as override key format or precedence rules, 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?

Specific verb-and-resource pairing ('mirror of the live C# risk engine sizing') with an enumerated breakdown of the four computation stages, which makes it clearly a diagnostic/explanation tool rather than a validator or cost checker. No sibling is named or explicitly excluded, so it falls short of full sibling differentiation.

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 only implied by the word 'explain' plus the component list — an agent can infer it should be called to understand how a size was derived. There is no explicit when-to-use clause, no when-not-to-use, and no routing versus warden.validate_order or warden.cost_check, both of which plausibly overlap.

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