Skip to main content
Glama

TradingCalc MCP: Options, Forex, Risk Stats, Prediction Markets, On-Chain & Crypto Futures

EVT Tail Risk

workflow.run_evt_tail_risk
Read-only

Extreme Value Theory tail risk (Peaks-Over-Threshold): fits a Generalized Pareto Distribution to the losses beyond a high threshold via Grimshaw's (1993) profile-likelihood MLE, then extrapolates VaR/Expected Shortfall at the requested confidence, without assuming a normal distribution. Use when user asks "what's my tail VaR without assuming normality?" or "how fat is my loss tail, really?". Complements workflow.run_var_cvar (parametric, normal-distribution VaR/CVaR) for exactly the fat-tailed-return case that assumption understates. threshold_percentile (default 90) sets which percentile of the loss distribution (losses = -returns) becomes the threshold u; confidence must be deep enough into the fitted tail (1-confidence < the threshold's own exceedance rate) or the call throws. Returns: threshold, n_exceedances, exceedance_rate, xi (GPD shape: 0=exponential tail, >0=heavy/fat tail, <0=bounded tail; values <= -1 are excluded from the fit domain as a known non-regular/unbounded-likelihood case, Smith 1985), beta (GPD scale), xi_asymptotically_normal (false when xi<=-0.5: the fit is still valid but the usual MLE confidence-interval theory doesn't apply, per that same Smith 1985 result), var, es (null when xi>=1, where Expected Shortfall is mathematically undefined).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
returnsYesReturn series, one value per period, at least 100 values (POT needs real sample depth in the tail)
confidenceNoVaR/ES confidence level, 0-1 exclusive. Default 0.99. Must satisfy 1-confidence < the threshold's own exceedance rate.
threshold_percentileNoPercentile (0-100 exclusive) of the loss distribution used as the POT threshold u. Default 90.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations cover the safety profile (readOnly, non-destructive), so the burden is lower, yet the description still discloses real behavioral traits: the confidence-vs-threshold feasibility constraint that triggers an exception, and edge-case semantics for xi, xi_asymptotically_normal, and es becoming null when xi>=1. It omits runtime/cost characteristics, but the error and domain conditions are unusually well documented.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core operation and use case, which is good, but the trailing 'Returns:' block is a long, dense enumeration of six fields with heavy parenthetical citations. It is information-dense but borders on over-specification and would be better absorbed by an output schema.

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?

For a 3-parameter, no-output-schema tool, this covers method, use case, sibling differentiation, parameter meaning, error conditions, and return fields — an agent has what it needs to call it correctly. Not perfect only because return semantics are embedded in prose rather than a schema, and expected input format conventions (e.g., ordered series, sampling frequency) are left implicit.

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 already documents all three parameters, so the baseline is 3. The description goes beyond by explaining the domain meaning of threshold_percentile (percentile of the loss distribution, losses = -returns) and the cross-parameter constraint on confidence, adding interpretation rather than restating format.

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?

States a precise verb and resource (fits a GPD to tail losses and extrapolates VaR/ES) and distinguishes itself from the sibling workflow.run_var_cvar by contrasting the distributional assumptions. An agent can route between the two without opening schemas.

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 explicit triggering user phrasings ('what's my tail VaR without assuming normality?') and names the alternative tool (workflow.run_var_cvar) together with the condition that selects it — the fat-tailed case that normal parametric VaR understates. When-to-use and when-to-prefer-the-sibling are both present.

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.