Skip to main content
Glama

crashtestyourstrategy

Factor / concentration decomposition (capital weight vs risk)

factor_decomposition
Read-onlyIdempotent

USE WHEN you suspect a capital-diversified portfolio hides one dominant risk factor. A portfolio can be capital-diversified while its RISK is dominated by one factor. Returns the Euler risk contribution of each holding (RC_i = w_i*(Sigmaw)_i / w'Sigmaw, summing to 1) beside the capital weights, from the empirical covariance of real returns. Proxies: SPY=equity beta, TLT=duration, GOLD=real asset, BTC=crypto. E.g. a 60/40 is ~83% equity risk, a 50/50 SPY/BTC ~86% BTC risk. Descriptive, not advisory.

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": {
      "holdings": "<holdings>"
    },
    "name": "factor_decomposition"
  }
}

Input Schema

NameRequiredDescriptionDefault
holdingsYesPortfolio legs: list of {asset, weight} objects, e.g. [{'asset': 'SPY', 'weight': 0.6}, {'asset': 'TLT', 'weight': 0.4}]. Assets: SPY, TLT, GOLD, BTC or CASH (aliases GLD, BTC-USD). Weights are normalised to sum to 1 and MAY be negative here (a net short leg); at most 50 legs, no duplicates. Each substrate asset proxies a factor (SPY=equity beta, TLT=duration, GOLD=real asset, BTC=crypto).

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / holdings / description
      Previous value: -"Portfolio legs: list of {asset, weight} objects, e.g. [{'asset': 'SPY', 'weight': 0.6}, {'asset': 'TLT', 'weight': 0.4}]. Weights are normalised to sum to 1; assets must be in the substrate universe. Each substrate asset proxies a factor (SPY=equity beta, TLT=duration, GOLD=real asset, BTC=crypto)."New value: +"Portfolio legs: list of {asset, weight} objects, e.g. [{'asset': 'SPY', 'weight': 0.6}, {'asset': 'TLT', 'weight': 0.4}]. Assets: SPY, TLT, GOLD, BTC or CASH (aliases GLD, BTC-USD). Weights are normalised to sum to 1 and MAY be negative here (a net short leg); at most 50 legs, no duplicates. Each substrate asset proxies a factor (SPY=equity beta, TLT=duration, GOLD=real asset, BTC=crypto)."
  2. Changed1 schema field changed
    • addedInput schema / properties / holdings / description
      Added value: +"Portfolio legs: list of {asset, weight} objects, e.g. [{'asset': 'SPY', 'weight': 0.6}, {'asset': 'TLT', 'weight': 0.4}]. Weights are normalised to sum to 1; assets must be in the substrate universe. Each substrate asset proxies a factor (SPY=equity beta, TLT=duration, GOLD=real asset, BTC=crypto)."
  3. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive, closed-world behavior, and the description adds real context beyond them: the calculation is based on empirical covariance of actual returns, weights are normalized, and the output is 'descriptive, not advisory.' Minor gap: no note on cost/latency of the empirical covariance computation or data recency.

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 the trigger, then the formula, then proxies and two numeric illustrations, so the agent can stop reading early. The proxy mapping (SPY=equity beta, etc.) is duplicated verbatim from the schema, which is the only wasted content.

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?

With one required parameter, full schema coverage, an output schema, and complete safety annotations, the description supplies everything else an agent needs: the trigger condition, the metric definition, and the interpretation framing. Nothing material is missing.

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% and the holdings parameter description already documents the {asset, weight} shape, allowed tickers, aliases, normalization, negative weights, 50-leg cap, and duplicate restriction. The description largely repeats the proxy mapping and the 60/40 example rather than adding new parameter meaning, so the 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?

States a specific computation: Euler risk contribution per holding (RC_i = w_i*(Sigma*w)_i / w'Sigma*w) reported beside capital weights, derived from the empirical covariance of real returns. The purpose is unambiguous, but no sibling tool (e.g. portfolio_stress_test, portfolio_frontier) is named or contrasted, so the top band is not reached.

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

Usage Guidelines4/5

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

Opens with an explicit trigger: 'USE WHEN you suspect a capital-diversified portfolio hides one dominant risk factor,' which tells the agent the exact diagnostic situation. It gives no when-not conditions and does not route the agent to an alternative tool for adjacent questions.

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.