Skip to main content
Glama
wanxinwanxin

riskprism

by wanxinwanxin

get_portfolio_risk

Calculate full portfolio risk from ticker weights, including total/factor/specific volatility, factor exposures, and top variance and asset risk contributions.

Instructions

Full risk report for a portfolio: total/factor/specific vol, factor exposures, top factor variance contributions, and top asset risk contributions. weights maps ticker -> portfolio weight. ETF and mutual fund tickers expand into their filed holdings before the math runs (set lookthrough=false to disable); funds the model cannot cover are reported in lookthrough.notes. Set optimized=true if the weights came from optimizing against this model: reported vols then include the Shepard second-order correction (optimizers exploit covariance estimation noise, so raw forecasts understate an optimized portfolio's risk). horizon: "medium" or "short" (responsive variant, when available).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
horizonNomedium
weightsYes
optimizedNo
lookthroughNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.9.2
    • addedInput schema / properties / lookthrough
      Added value: +{
      +  "default": true,
      +  "title": "Lookthrough",
      +  "type": "boolean"
      +}
  2. First observedv0.9.1

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description must carry the full behavioral burden and it does: it discloses that ETF/mutual fund tickers are expanded into filed holdings before computation, that uncoverable funds surface in lookthrough.notes, and that optimized=true applies the Shepard second-order correction because optimizers exploit covariance noise. It lacks any note on cost, latency, or failure behavior for malformed tickers.

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 output summary is front-loaded in the first sentence and each subsequent sentence covers one parameter, so the structure is easy to scan. It is dense with parentheticals and slightly long for four parameters, but nearly every clause carries non-obvious 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?

There is no output schema, and the description compensates by naming the returned sections (total/factor/specific vol, factor exposures, top variance and asset risk contributions, lookthrough.notes). Combined with the semantics for all four parameters and the nested weights object, an agent has enough to call this correctly; only error/edge behavior is unaddressed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for all four parameters and it does: weights is defined as ticker -> portfolio weight, lookthrough and optimized each get their effect and default implication, and horizon is given its allowed values ('medium' or 'short'). No parameter is left for the agent to guess at.

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 verb and resource ('Full risk report for a portfolio') and enumerates the report's contents, so an agent knows exactly what comes back. It never names or contrasts against siblings like get_etf_risk or get_factor_exposures, so sibling differentiation is left implicit.

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 description gives real conditional guidance for options ('set lookthrough=false to disable', 'set optimized=true if the weights came from optimizing against this model'), which is genuine when-to-use information. However it never says when to pick this tool over get_etf_risk, get_factor_exposures, or stress_test, so routing between siblings remains inferred.

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