Skip to main content
Glama
datalattice

mcp-chainladder

by datalattice

mack_diagnostics

Run three statistical tests and standardised-residual outlier detection to validate chain ladder model assumptions, including calendar-year, independence, and inflation effects.

Instructions

Mack (1994) assumption diagnostics — three statistical tests plus standardised-residual outlier detection. Use when the user asks "does the chain ladder look OK?", "are there any outliers?", or "should I be worried about [calendar-year / inflation / dependence] effects?".

Args: triangle: As in compute_chain_ladder. selected_factors: Length-(n_dev - 1) factor set. excluded: Outlier exclusions to honour. outlier_threshold: Absolute standardised-residual threshold for flagging an outlier. Default 2.0 (the Tk app's default).

Returns: - standardised_residuals: list[list[float | null]] — per-cell residual r[i,j] = (C[i,j+1] − f_j·C[i,j]) / (σ_j·√C[i,j]); null where the cell is excluded or the pair is unobserved - outliers: list of {row: int, dev: int, residual: float} — cells with |residual| > outlier_threshold - calendar_year: {z: float, p_two_sided: float} — Tarbell sign test for calendar-year effects (large |z| ⇒ suspect) - independence: {z: float, p_two_sided: float} — Spearman rank-correlation between adjacent development columns (large |z| ⇒ link ratios are not independent) - inflation: {slope: float, p_value: float} — OLS slope of mean(ln link-ratio) on accident-year index (non-zero ⇒ accident-year trend in link ratios)

Verdict guidance for translating p-values to plain English: p < 0.005 → "strong evidence"; p < 0.05 → "significant"; p < 0.10 → "borderline"; p ≥ 0.10 → "no evidence".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
triangleYes
selected_factorsYes
excludedNo
outlier_thresholdNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Discloses the three statistical tests performed, outlier detection method, and return structure including formula for residuals. No side effects mentioned, but appropriate for a read-only diagnostic tool.

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

Conciseness4/5

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

Well-organized with Args, Returns, and Verdict guidance sections. Front-loaded with purpose. Slightly lengthy but justified by the complexity of the tool.

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?

Provides complete information including return values with types and interpretation guidance. Given the presence of an output schema (described in text), the description covers all necessary context for correct invocation.

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

Parameters5/5

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

Adds detailed descriptions for all 4 parameters beyond the schema (which has 0% coverage). Explains each parameter's role, including defaults and relationships (e.g., selected_factors length, outlier_threshold default).

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?

Explicitly states it performs Mack (1994) assumption diagnostics including three tests and outlier detection, and gives example use cases. Distinguishes itself from siblings like compute_chain_ladder and interpret_diagnostics by focusing on statistical tests.

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 scenarios: when user asks about chain ladder assumptions, outliers, or specific effects. Implicitly ties to compute_chain_ladder but lacks explicit when-not-to-use or alternative tool names.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/datalattice/mcp-chainladder'

If you have feedback or need assistance with the MCP directory API, please join our Discord server