Skip to main content
Glama
John-Amal

Tail-Risk-Toolkit

by John-Amal

tailrisk_fit_gpd

Read-onlyIdempotent

Fit a generalized Pareto distribution to threshold exceedances to measure tail heaviness and identify whether extreme events are unbounded, exponentially bounded, or have a finite worst case.

Instructions

Fit a generalised Pareto distribution to threshold exceedances.

Use this first when asked how heavy a tail is. The shape parameter is the headline number: above zero means a heavy tail with no upper bound, near zero means exponential decay, below zero means a finite worst case.

Returns: str: JSON with keys threshold, shape, scale, n_observations, n_exceedances, exceedance_rate, log_likelihood and an interpretation string.

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.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds useful behavioral context: how to interpret the shape parameter and what keys the returned JSON contains. No contradiction with 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?

The description is compact and front-loaded: purpose first, usage signal second, interpretation guidance third, and return format last. Every sentence earns its place without redundant filler.

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 statistical fitting tool, the description covers purpose, usage timing, interpretation, and return keys. Combined with the detailed nested schema and annotations, this is nearly complete; only minor gaps like default threshold behavior are left to the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description does not explain how to set tail, threshold, threshold_quantile, or values, even though schema description coverage is reported as 0%. The schema itself contains useful parameter descriptions, but the tool description provides no compensating guidance for parameter selection.

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 states a precise action: fit a generalised Pareto distribution to threshold exceedances. It also clarifies the headline result (shape parameter) and what its sign means, making the tool's purpose unmistakable and distinct from sibling tail-risk tools.

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 explicitly says 'Use this first when asked how heavy a tail is,' giving clear when-to-use guidance. It does not, however, name sibling tools or describe when to prefer tailrisk_var_es, tailrisk_return_level, or the others instead.

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