Skip to main content
Glama

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

VaR and CVaR

workflow.run_var_cvar
Read-only

Parametric Value at Risk (VaR) and Conditional VaR / Expected Shortfall (CVaR), the variance-covariance method (assumes normally distributed returns), plus Modified VaR (Cornish-Fisher skew/kurtosis correction, Boudt/Peterson/Croux) when a return series is supplied. Supply either a return series or a mean/stdev pair directly, at a confidence level. Output is at the same periodicity as the input (no automatic annualization) - a daily return series gives a daily VaR/CVaR. Use when user asks "what's my VaR at 95%/99%?", "what's my expected shortfall on this position?", or "does my Sharpe/VaR estimate need a fat-tails correction?". Returns: var, cvar (both positive loss magnitudes; cvar >= var always), z, mean, stdev, skewness, excess_kurtosis (both null unless 3+ returns were supplied), var_modified (skew/kurtosis-adjusted VaR; null when skewness is, OR when this series' skew/kurtosis are too extreme for the Cornish-Fisher expansion to be a valid quantile - skewness/excess_kurtosis are still returned in that case).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
meanNoMean return, if not supplying returns[] directly
stdevNoStandard deviation of returns, if not supplying returns[] directly
returnsNoReturn series (e.g. daily % returns as decimals). Provide this OR mean+stdev, not both.
confidenceNoConfidence level, 0-1 exclusive (default 0.95)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already mark this as read-only, non-destructive, and non-open-world, but the description adds substantial behavioral detail: no automatic annualization, positivity of var/cvar, the cvar >= var invariant, and exactly when skewness, excess_kurtosis, and var_modified are null. This is rich disclosure beyond the annotations.

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

Conciseness5/5

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

It is dense but front-loaded with the core purpose and method, then usage triggers, then output details. Given the absence of an output schema, the long Returns sentence is necessary and every clause carries useful information.

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 computation tool with four optional parameters, no output schema, and safety annotations already present, the description covers input modes, method variants, output fields, and edge-case null behavior. Nothing an agent needs to invoke it correctly appears to be 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 description coverage is 100%, so the parameter meanings are already fully documented. The description repeats the either/or input requirement and confidence level but adds little syntax or format detail beyond the schema, matching the baseline for high schema coverage.

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 the specific computation and methods: parametric VaR/CVaR via variance-covariance, plus Modified VaR with Cornish-Fisher correction. This clearly separates it from broader risk tools like run_portfolio_risk or run_evt_tail_risk without needing to open the schema.

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?

Provides clear usage triggers such as 'what's my VaR at 95%/99%?' and 'what's my expected shortfall on this position?' and explains that either returns or mean/stdev are supplied. It does not explicitly state when not to use it or name an alternative sibling, so it falls short of a 5.

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.