Skip to main content
Glama

Optimize Portfolio Weights

warden.optimize_portfolio
Read-onlyIdempotent

Computes volatility-targeted dual-momentum, HRP, or shrinkage mean-variance weights under concentration and turnover caps, sweeping residual capital to cash without trading.

Instructions

Computes volatility-targeted dual-momentum, hierarchical risk parity, or shrinkage mean-variance portfolio weights under the house concentration and turnover caps. Residual capital is swept to the defensive cash proxy; never places or routes trades. Pro tool.

Input Schema

NameRequiredDescriptionDefault
top_kNoMaximum number of active risk slots to select.
methodNoAllocation method: vol_target_momentum | hrp | mvo_shrinkage.vol_target_momentum
candidatesYesCandidate risk assets: [{symbol, momentum_score, realized_vol_annual, above_trend_sma?, chandelier_triggered?, current_weight?}].
turnover_capNoMaximum one-way portfolio turnover fraction per rebalance.
floor_overridesNoOptional per-fund overrides {max_position_pct, max_gross_exposure_pct}.
cash_proxy_symbolNoDefensive cash proxy ticker receiving unallocated weight.SGOV
target_volatilityNoTarget annualized portfolio volatility (e.g. 0.12 for 12%).
cash_momentum_scoreNoComposite momentum score of the defensive cash proxy.

Output Schema

NameRequiredDescriptionDefault
howNo
toolNo
errorNo
accessNo
methodNo
safetyNo
verdictNo
provenanceNo
filtered_outNo
house_floorsNo
target_weightsNo
cash_proxy_symbolNo
cash_sweep_weightNo
request_access_atNo
overrides_deviationNo
selected_risk_assetsNo
gross_risk_exposure_pctNo
estimated_turnover_one_wayNo
estimated_portfolio_vol_annualNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.2

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover readOnly/idempotent/non-destructive, but the description adds real behavioral context: residual capital is swept to the defensive cash proxy, house concentration and turnover caps are enforced, and it explicitly declares it never places or routes trades. That last point is valuable disambiguation from order-execution siblings.

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 the core computation front-loaded, plus a short exclusions clause. 'Pro tool.' is terse but arguably conveys tiering; nothing is bloated, though the trailing fragment is slightly cryptic.

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?

An output schema exists, so return values needn't be described. With 8 fully documented params, read-only annotations, and stated caps and cash-sweep behavior, the definition is nearly complete; it only lacks guidance on choosing between this and the rebalance/explain siblings.

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% across all 8 params, so the baseline is 3. The description echoes the three method names and mentions caps and the cash proxy, but adds no syntax, units, or interaction guidance (e.g., how floor_overrides interact with the house caps) beyond what the schema documents.

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?

Names a specific verb ('Computes') and resource ('portfolio weights'), and enumerates the three distinct allocation methods (dual-momentum, HRP, shrinkage mean-variance). This is far more precise than siblings like explain_sizing or plan_rebalance, letting an agent route correctly without opening a 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?

Implied usage: the tool computes weights and never routes trades, so an agent can infer it slots before plan_rebalance/validate_order. But there is no explicit 'use this when X, use sibling Y instead' guidance, and 'Pro tool' hints at gating without saying how it affects selection.

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