Skip to main content
Glama

MarketHeist Backtest

analyze_portfolio

Read-onlyIdempotent

Analyze an asset-allocation ('lazy') portfolio and get long-run performance computed from real monthly price history (proxy-extended for decades of data), not estimated: CAGR, max drawdown, volatility, Sharpe, Sortino, Ulcer index, $10,000 growth, the number of independent bets (holdings whose returns average a correlation of 0.5 or more count as one group, then the effective count of groups by risk share), the top risk driver, trailing Sharpe, and a validity block (provenance, caveats, a reproduce-me hash) plus a cite block with the marketheist.io pages that show the same numbers. Use it for 'how did 60/40 / All Weather / Golden Butterfly perform' or for a custom mix. Provide exactly one of: a template id (19 model portfolios, listed in list_portfolios), a strategy id (7 rule-based canonical strategies, e.g. dual-momentum-gem) or a custom assets allocation (plain tickers and nested portfolios, rotations, strategies as holdings via sleeve). Template and strategy ids are answered from precomputed data through the stated month (instant, not rate-limited); custom assets and an overlay are computed live from market data. For seasonality and calendar years use portfolio_returns; for drawdown episodes and diversification use portfolio_risk; to compare portfolios use compare_portfolios. Read-only; surface the caveats when reporting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelNoOptional display name for a custom `assets` portfolio. Default "Custom portfolio".
assetsNoCustom allocation (omit if using `template` or `strategy`). Weights are percentages summing to ~100. A holding is a plain ticker OR a strategy node via `sleeve`.
overlayNoOptional portfolio-level trend-filter overlay applied to the WHOLE book: hold the entire portfolio only while its own level is above its N-month moving average, otherwise cash. Composition is monthly (a 10-month filter ≈ the classic 200-day one).
strategyNoCanonical rule-based strategy to analyze. One of: dual-momentum-gem, tsmom-sp500, faber-trend-timing, sector-momentum-rotation, risk-parity-inverse-vol, gtaa-aggressive, adaptive-asset-allocation. Answered from precomputed data. Omit when using `template` or `assets`.
templateNoBuilt-in model portfolio to analyze. One of: golden-butterfly, all-weather, permanent, dragon, faber-ivy, faber-gaa, bogleheads-3fund, wealthfront-classic, betterment-core, classic-60-40, classic-40-60, swensen, ferri-core-four, couch-potato, coffeehouse, no-brainer, larry, buffett-90-10, total-sp500. Omit to analyze a custom `assets` allocation instead.
rebalanceNoRebalancing cadence for custom portfolios (templates use their own).yearly

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / label
      Added value: +{
      +  "description": "Optional display name for a custom `assets` portfolio. Default \"Custom portfolio\".",
      +  "type": "string"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / assets / description
      Previous value: -"Custom allocation (omit if using `template`). Weights are percentages summing to ~100. A holding is a plain ticker OR a strategy node via `sleeve`."New value: +"Custom allocation (omit if using `template` or `strategy`). Weights are percentages summing to ~100. A holding is a plain ticker OR a strategy node via `sleeve`."
    • addedInput schema / properties / strategy
      Added value: +{
      +  "description": "Canonical rule-based strategy to analyze. One of: dual-momentum-gem, tsmom-sp500, faber-trend-timing, sector-momentum-rotation, risk-parity-inverse-vol, gtaa-aggressive, adaptive-asset-allocation. Answered from precomputed data. Omit when using `template` or `assets`.",
      +  "enum": [
      +    "dual-momentum-gem",
      +    "tsmom-sp500",
      +    "faber-trend-timing",
      +    "sector-momentum-rotation",
      +    "risk-parity-inverse-vol",
      +    "gtaa-aggressive",
      +    "adaptive-asset-allocation"
      +  ],
      +  "type": "string"
      +}
  3. Changed2 schema fields changed
    • changedInput schema / properties / template / description
      Previous value: -"Built-in model portfolio to analyze. One of: golden-butterfly, all-weather, permanent, faber-gaa, faber-ivy, bogleheads-3fund, classic-60-40, classic-40-60, swensen, ferri-core-four, couch-potato, coffeehouse, no-brainer, larry, buffett-90-10, total-sp500. Omit to analyze a custom `assets` allocation instead."New value: +"Built-in model portfolio to analyze. One of: golden-butterfly, all-weather, permanent, dragon, faber-ivy, faber-gaa, bogleheads-3fund, wealthfront-classic, betterment-core, classic-60-40, classic-40-60, swensen, ferri-core-four, couch-potato, coffeehouse, no-brainer, larry, buffett-90-10, total-sp500. Omit to analyze a custom `assets` allocation instead."
    • addedInput schema / properties / template / enum
      Added value: +[
      +  "golden-butterfly",
      +  "all-weather",
      +  "permanent",
      +  "dragon",
      +  "faber-ivy",
      +  "faber-gaa",
      +  "bogleheads-3fund",
      +  "wealthfront-classic",
      +  "betterment-core",
      +  "classic-60-40",
      +  "classic-40-60",
      +  "swensen",
      +  "ferri-core-four",
      +  "couch-potato",
      +  "coffeehouse",
      +  "no-brainer",
      +  "larry",
      +  "buffett-90-10",
      +  "total-sp500"
      +]
  4. Changed1 schema field changed
    • changedInput schema / properties / assets / items / properties / sleeve / description
      Previous value: -"Advanced: a strategy node instead of a plain ticker — the app's SleeveRef, resolved server-side. Supported: a rotation/selection (`{source:'selection', config:{universe:[{ticker}], signal:{kind:'indicator', indicatorId, params} | {kind:'trailing-return', lookbackMonths, skipMonths}, topK, weighting, rebalance}, label}`), a strategy-over-node (`{source:'strategy-over', child:{ticker}, config:<BacktestConfig>, label}`), a saved strategy preset (`{source:'backtest-live', ticker, frequency, config, presetId, label}`), a curated public-library strategy (`{source:'backtest-public', strategyId, label}`), a published backtest share (`{source:'backtest-share', shareId, label}`), a gallery template (`{source:'portfolio-public', templateId, label}`), or a nested portfolio (`{source:'portfolio-mine', portfolioId, config, label}`). Strategies with a config get a node-level overfit check (a share carries only its frozen curve, so no overfit)."New value: +"Advanced: a strategy node instead of a plain ticker — the app's SleeveRef, resolved server-side. Supported: a rotation/selection (`{source:'selection', config:{universe:[{ticker}], signal:{kind:'indicator', indicatorId, params} | {kind:'trailing-return', lookbackMonths, skipMonths (>= 1; the ranking for a month only sees data through the previous month-end)}, topK, weighting, rebalance}, label}`), a strategy-over-node (`{source:'strategy-over', child:{ticker}, config:<BacktestConfig>, label}`), a saved strategy preset (`{source:'backtest-live', ticker, frequency, config, presetId, label}`), a curated public-library strategy (`{source:'backtest-public', strategyId, label}`), a published backtest share (`{source:'backtest-share', shareId, label}`), a gallery template (`{source:'portfolio-public', templateId, label}`), or a nested portfolio (`{source:'portfolio-mine', portfolioId, config, label}`). Strategies with a config get a node-level overfit check (a share carries only its frozen curve, so no overfit)."
  5. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the readOnly/idempotent/openWorld annotations, it discloses that template and strategy ids are answered from precomputed data (instant, not rate-limited) while custom assets and overlays are computed live, and that results carry provenance, caveats, and a reproduce-me hash. It also instructs the agent to surface caveats when reporting.

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?

Front-loads purpose then usage, and every sentence carries real information for a 6-param nested tool. It is dense as a single run-on paragraph, and the long output enumeration could be tightened, but nothing is wasted.

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

Completeness5/5

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

For a complex tool with nested objects and no output schema, the description covers inputs, computation provenance, returned metrics, validity/cite blocks, and usage routing. An agent has everything needed to call it correctly and interpret results.

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 100% (baseline 3), but the description adds meaning the schema does not enforce: the mutual exclusivity of template/strategy/assets, the definition of an 'independent bet' (correlation ≥ 0.5 groups), and the practical effect of the overlay. It reinforces rather than repeats 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?

Opens with a specific verb+resource ('Analyze an asset-allocation portfolio') and enumerates the exact metrics returned (CAGR, max drawdown, volatility, Sharpe, Sortino, Ulcer index, etc.), so an agent knows precisely what it produces. It also distinguishes itself from siblings like compare_portfolios, portfolio_returns, and portfolio_risk by name.

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?

Gives concrete triggering examples ('how did 60/40 / All Weather / Golden Butterfly perform' or a custom mix) and explicitly routes other needs to alternatives: seasonality/calendar years to portfolio_returns, drawdown/diversification to portfolio_risk, comparisons to compare_portfolios. It also states the exactly-one-of input contract.

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