Skip to main content
Glama

Would refitting have helped? (out of sample)

walk_forward
Read-onlyIdempotent

Whether re-optimising an allocation would have helped: fit on the years before each date, hold on prices it had not seen, repeat, and compare that record with the portfolio actually held and with equal weights. Use it only when the reader asks whether an optimiser would have beaten what they hold; it is not for choosing weights. tickers are the candidates (2 to 30); holdings, if given, is the portfolio compared against; objective picks what each fit maximises (default max_sharpe); train_years and step_months set how much history each fit uses and how often it refits. Returns the record, never an allocation to hold.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseNoCurrency every figure is expressed in (USD, EUR, GBP, CAD…). Default USD.
tickersYesThe candidate holdings, 2 to 30.
holdingsNoOptional: the portfolio actually held, {ticker: weight}, measured on the same span for comparison.
objectiveNoWhat each refit maximises or minimises: max_sharpe, min_variance, min_drawdown, min_cvar or max_quadratic_utility.max_sharpe
step_monthsNoMonths each fitted mix is held.
train_yearsNoYears of history each refit sees.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNoWhere the prices came from and what was missing or repaired.
_fenceYesWhat these figures are and are not: descriptive, no forecast, no advice. Repeat its sense when presenting the result.
objectiveNoWhat each refit optimised.
fitted_windowNoFirst and last date of shared history.
out_of_sampleNostart, end, n_refits, train_years, step_months, mean_turnover, verdict (one sentence on the record), limitations, tracks (per track: label, cagr, vol, sharpe, max_drawdown, nav), refits (date, turnover); or `unavailable` with the reason.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so the safety profile is covered. The description adds real behavioral context beyond that: refit windows (train_years, step_months), the comparison baseline (equal weights), and the crucial caveat that it 'returns the record, never an allocation to hold' — clarifying that no actionable weights come back.

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?

The purpose is front-loaded in the first sentence, followed by usage guidance and then parameter roles, so ordering is logical. The prose is dense and long-winded in places (the refit loop is described twice, once narratively and once via train_years/step_months), but every 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?

With an output schema present, return values need not be enumerated, and annotations carry the safety profile, so the description only needs usage, method and param context — all of which are supplied. The one gap is that 'base' is only explained in the schema, but that is covered there, leaving the definition effectively complete.

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 structured schema already documents every parameter including base and the enum-like objective values. The description restates roles for tickers, holdings, objective, train_years and step_months but adds no syntax or format detail beyond the schema, and omits base entirely. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

The description names a concrete procedure (fit on prior years, hold on unseen prices, repeat, compare against the held portfolio and equal weights) rather than restating the title, so an agent knows this is an out-of-sample walk-forward evaluation. It also carves out what it is not ('not for choosing weights'), which separates it from weight-selection siblings, though it does not name a specific sibling tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives an explicit trigger ('use it only when the reader asks whether an optimiser would have beaten what they hold') and an explicit exclusion ('it is not for choosing weights'). The when-to-use condition is unambiguous and tied to the reader's intent.

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.

Resources