Skip to main content
Glama

Pre-Trade Rebalance Risk Gate

warden.plan_rebalance
Read-onlyIdempotent

Plan portfolio rebalancing by validating drawdown circuit breakers, feature drift guards, turnover buffer, and bid-ask spread gates; sequences sells before buys without routing trades.

Instructions

Checks the portfolio drawdown circuit breaker, feature drift guard, 3% turnover drift buffer, and bid-ask spread gate. Sequences sell reductions before buy additions with marketable limit collars; never routes trades.

Input Schema

NameRequiredDescriptionDefault
equityYesCurrent account equity in base currency.
quotesNoOptional quote snapshot {symbol: {bid, ask} or {mid, spread_bps}}.
feature_psiNoOptional Population Stability Index of input features (>0.25 halts risk additions).
max_spread_bpsNoMaximum allowed bid-ask spread in bps before rejecting execution.
target_weightsYesTarget portfolio weights {symbol: weight_fraction}.
drift_thresholdNoMinimum weight drift fraction required to trigger a rebalance step.
high_water_markYesPortfolio historical high-water mark equity.
limit_collar_bpsNoMarketable limit price collar around midprice in bps.
cash_proxy_symbolNoDefensive cash sweep ticker.SGOV
current_positionsNoOptional current position notionals {symbol: notional}.
max_drawdown_limitNoMaximum drawdown from high-water mark before circuit-breaker liquidation.

Output Schema

NameRequiredDescriptionDefault
howNo
toolNo
errorNo
accessNo
safetyNo
verdictNo
provenanceNo
drawdown_pctNo
house_floorsNo
sequenced_planNo
psi_drift_trippedNo
request_access_atNo
spread_violationsNo
circuit_breaker_trippedNo
effective_target_weightsNo
skipped_within_drift_bandNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.2

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnly=true, idempotent=true, destructive=false and closed-world, so safety is covered. The description adds real behavioral substance beyond that: the four named gates, the sell-before-buy sequencing intent, and the explicit statement that it never routes trades. It does not, however, say what happens on a breach (halt vs. partial plan vs. rejection), which is the key operational behavior an agent needs.

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 dense sentences with no filler, and the enumeration of checked guards is front-loaded. The jargon load is high but each clause carries information.

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?

For an 11-parameter, nested-object planning tool with an output schema (so return format needn't be explained), the description gives enough to know the decision logic involved. The gap is the post-evaluation contract — what a breach produces and how the ordered sell/buy steps are surfaced — which the output schema may cover.

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 coverage is 100%, so the schema already documents all 11 parameters and the baseline is 3. The description gestures at several parameters — the 3% turnover buffer (drift_threshold), marketable limit collars (limit_collar_bps), the bid-ask spread gate (max_spread_bps), the drawdown breaker (max_drawdown_limit) — but without syntax, units, or interaction detail beyond what the schema states.

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 ('Checks') plus a precisely enumerated resource: the drawdown circuit breaker, feature drift guard, turnover drift buffer, and spread gate. The closing clause 'never routes trades' clearly separates it from an execution tool. It stops short of naming which sibling (e.g., validate_order) to prefer, so it is clear but not sibling-differentiating.

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 title 'Pre-Trade Rebalance Risk Gate' and the gate-checking framing imply this belongs before order submission, but the description never states when to call it versus warden.validate_order or warden.cost_check. Usage must be inferred from the tool's name and position in a pipeline.

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