Skip to main content
Glama
datalattice

mcp-chainladder

by datalattice

compute_chain_ladder

Project ultimate losses and estimate IBNR from a cumulative loss triangle using the chain-ladder method. Returns age-to-age factors, ultimates, and IBNR per accident year.

Instructions

Run a full chain-ladder reserving calculation on a cumulative loss triangle. This is the workhorse tool — call it whenever the user asks "what's the IBNR?", "what does the chain ladder say?", or hands you a triangle and asks for projections.

Args: triangle: Cumulative loss triangle as a list of lists. Outer index is the accident-year row (oldest first). Inner index is the development period (0 = first age). Cells are numbers or null; null means unobserved (typical lower-right corner of a real triangle). All rows should be the same length — pad with trailing nulls if needed. selected_factors: Optional list of user-chosen age-to-age factors, one per development-period transition (length = n_dev - 1). When omitted, the volume-weighted factors derived from the triangle are used as the selected set. tail: Multiplicative tail factor applied beyond the last development period. Default 1.0 (no tail). excluded: List of [row_i, dev_j] pairs identifying individual link ratios to drop from the volume and simple averages. Use this for outlier handling — typically after consulting mack_diagnostics to find suspect cells.

Returns: A dictionary containing: - volume_factors: list[float] — volume-weighted age-to-age - simple_factors: list[float] — simple average of link ratios - selected_factors: list[float] — the set actually used - individual_factors: list[list[float | None]] — per-row link ratios C[i, j+1] / C[i, j]; null where the pair is unobserved - cdf: list[float] — cumulative dev factors to ultimate; last element is tail - latest_diagonal: list[float] — most recent observed value per accident row - ultimates: list[float] — projected ultimate per accident row - ibnr: list[float] — Ultimate − Latest, per accident row - total_latest, total_ultimate, total_ibnr: float scalars - n_acc, n_dev: int — triangle dimensions for convenience

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
triangleYes
selected_factorsNo
tailNo
excludedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

No annotations are provided, so the description fully bears the responsibility of disclosing behavior. It thoroughly explains the computation, parameters, and output structure, including handling of nulls and the effect of optional arguments. This provides complete transparency for a mathematical 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?

The description is well-structured with a brief intro followed by clearly labeled Args and Returns sections. While it is detailed, every sentence provides necessary information. It could be slightly more concise, but the organization makes it easy to parse.

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 complexity of chain-ladder reserving and the presence of an output schema, the description is remarkably complete. It covers all inputs, default behaviors, and each field of the return dictionary. No gaps are evident for typical usage scenarios.

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?

The input schema has 0% description coverage (no parameter descriptions in the schema). The tool's description compensates fully with detailed explanations of each parameter (triangle format, selected_factors defaults, tail default, excluded format). This adds significant value beyond the schema's types and titles.

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 'Run a full chain-ladder reserving calculation on a cumulative loss triangle' and gives explicit usage cues like 'call it whenever the user asks "what's the IBNR?".' This distinguishes the tool from siblings such as bornhuetter_ferguson and mack_diagnostics.

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 provides context for when to use the tool ('when the user asks... or hands you a triangle and asks for projections') and labels it as the 'workhorse tool.' However, it does not explicitly mention when not to use it or contrast it with alternatives, which would improve the score.

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