Skip to main content
Glama
John-Amal

Tail-Risk-Toolkit

by John-Amal

tailrisk_threshold_stability

Read-onlyIdempotent

Scan candidate thresholds to check if tail shape estimates remain stable before trusting a single peaks-over-threshold fit.

Instructions

Refit across candidate thresholds to test whether the tail fit is stable.

Threshold choice is the main judgement call in a POT analysis. Call this before trusting a single fit: if the shape parameter drifts steadily with the threshold, the estimate is not yet in the asymptotic regime.

Returns: str: JSON with a scan list (one record per threshold, each with quantile, threshold, shape, scale, modified_scale, n_exceedances), the shape_range across the scan, and a stability 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.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the agent knows it's a safe read operation. The description adds valuable context: that the tool performs a scan across thresholds and provides a stability verdict, which goes beyond the annotations. There is no contradiction. It could detail the return format more, but the output schema covers that.

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 and front-loaded: it starts with the main purpose, then provides the key usage trigger, and ends with a precise return format. Each sentence earns its place, and there is no fluff.

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 presence of a rich output schema (detailing the scan list fields), the description is complete for an agent to decide when to call it and what to expect. The description plus annotations and output schema cover all necessary aspects: purpose, usage context, parameter meanings, and return structure. No critical information is missing.

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?

Despite schema description coverage being 0%, the description explicitly explains the `tail` parameter's usage: 'Use 'upper' for a loss series where large positive values are bad, 'lower' for a return series where large negative values are bad.' This adds significant meaning beyond the schema's enum. The `quantiles` parameter is described as 'Candidate threshold quantiles' with a default sweep, and `values` is straightforward. The description of the output scan list compensates for the lack of schema descriptions.

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 clearly states the tool's purpose: 'Refit across candidate thresholds to test whether the tail fit is stable.' It identifies the specific verb (refit/test), resource (thresholds for tail fit), and the analytical goal. It also distinguishes itself from sibling tools like tailrisk_fit_gpd by focusing on stability across thresholds, not a single fit.

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?

The description provides explicit guidance on when to use this tool: 'Call this before trusting a single fit' and explains the conditions that indicate instability ('if the shape parameter drifts steadily with the threshold'). It implies that tailrisk_fit_gpd is for single fits and should be used with this tool for validation. While it doesn't name the sibling explicitly, the context is clear.

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