Skip to main content
Glama
John-Amal

Tail-Risk-Toolkit

by John-Amal

tailrisk_backtest_var

Read-onlyIdempotent

Backtest value-at-risk models with rolling windows, using Kupiec and Christoffersen tests to verify breach rates and clustering for out-of-sample validation.

Instructions

Backtest a VaR model out of sample with Kupiec and Christoffersen tests.

Each forecast uses only trailing data, so the result is a genuine out-of-sample assessment of whether breaches occur at the right rate and without clustering. This is the evidence a model validation report needs.

Returns: str: JSON with n_forecasts, n_breaches, breach_rate, expected_breach_rate, the Kupiec, Christoffersen and conditional coverage statistics with p-values, and a plain-language verdict.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With readOnlyHint and idempotentHint provided by the annotations, the description adds extra behavioral value: 'Each forecast uses only trailing data, so the result is a genuine out-of-sample assessment.' It also discloses the exact JSON fields returned, which is meaningful detail beyond the annotated safety profile.

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?

The description is concise, front-loaded with the core purpose, and includes a structured return list rather than prose. Each sentence earns its place: purpose, no-lookahead guarantee, use-case context, and explicit output fields.

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?

Given the rich input schema, clear output description, and safety/lookahead disclosures, an agent has everything needed to invoke the tool correctly. No important invocation detail appears 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?

The description itself does not elaborate on parameters, but the input schema already provides rich per-property descriptions for tail, method, values, window, and confidence. Since the schema does the heavy lifting and the description does not contradict or extend it, the baseline of 3 is appropriate.

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?

The description leads with a specific verb and resource: 'Backtest a VaR model out of sample with Kupiec and Christoffersen tests.' This clearly differentiates the tool from siblings such as tailrisk_fit_gpd, tailrisk_var_es, and tailrisk_return_level, which deal with fitting and estimation rather than backtesting.

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?

The description gives clear context: it is the 'evidence a model validation report needs' for assessing whether VaR breaches occur at the right rate and without clustering. It stops short of explicitly naming alternative tools or stating when not to use it, so it earns a 4 rather than 5.

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