Skip to main content
Glama

pyeconomics

Value-at-risk and expected shortfall

risk_value_at_risk
Read-onlyIdempotent

VaR and expected shortfall as positive losses by the parametric normal, Cornish-Fisher, historical, Monte Carlo and RiskMetrics EWMA methods. Runs Value-at-risk and expected shortfall (risk.value_at_risk, version 1) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. The required calculation field selects one of: cornish_fisher, ewma, historical, monte_carlo, parametric. Every number carries its unit in the input schema; rates are decimals.

Input Schema

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the bar is lower, yet the description adds real content: results are stated as positive losses, and the response is a canonical bundle of validated inputs, outputs, warnings and manifest. That tells an agent what to expect beyond a bare number and that warnings may accompany a result. It stops short of describing failure modes or what triggers warnings.

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?

Three sentences, front-loaded with the defining statement (what is measured and by which methods). The middle sentence is partly tautological — 'Runs Value-at-risk and expected shortfall (risk.value_at_risk, version 1) on the given inputs' restates the tool name — but it recovers by describing the result envelope. Minimal waste overall.

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-value detail is not required, and the description supplies the crucial sign convention (positive losses) plus the presence of warnings and a manifest. For a five-branch oneOf model with 100% schema coverage, the main remaining gap is method-selection guidance rather than missing mechanics.

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% and the schema is exceptionally rich (defaults, ranges, units, per-method descriptions), so baseline would be 3. The description earns the extra point by flagging the unit convention explicitly — every number carries its unit in the schema and rates are decimals — which prevents the common percent-vs-decimal input error, though its enumeration of the 'calculation' values merely restates the schema discriminator.

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 first sentence names a specific resource (VaR and expected shortfall), a precise measurement convention (positive losses), and enumerates all five supported methods. It never compares itself to siblings such as performance_risk_adjusted or portfolio_mean_variance, so an agent must infer the boundary from names alone, which holds it back from a 5.

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?

Usage is only implied: the description states that the required 'calculation' field selects one of cornish_fisher, ewma, historical, monte_carlo or parametric, which tells an agent what must be supplied. It gives no advice on when to choose one method over another (e.g. when returns are available vs. only moments), and no explicit statement of when to use this tool rather than a sibling risk tool.

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.