Skip to main content
Glama

Percentiles

percentiles
Read-onlyIdempotent

Compute p50/p90/p95/p99 percentile cutoffs from a numeric sample using nearest-rank and linear interpolation. Alerts when sample size under 100, as p99 then equals the maximum.

Instructions

p50/p90/p95/p99 (the 50th/90th/95th/99th percentile cutoffs) by nearest-rank AND linear interpolation. Pairs with calc_stats, which gives mean/median/stdev/CV on the same sample instead of these distribution points.

Warns when n < 100 that p99 is just the maximum wearing a label.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
numsYesSample of numbers to compute p50/p90/p95/p99 for, by nearest-rank and linear interpolation

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.12.0
    • addedInput schema / properties / nums / description
      Added value: +"Sample of numbers to compute p50/p90/p95/p99 for, by nearest-rank and linear interpolation"
  2. Changed1 schema field changedv0.11.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "percentilesDictOutput",
      +  "type": "object"
      +}
  3. Changed4 schema fields changedv0.2.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / nums / title
      Added value: +"Nums"
    • addedInput schema / title
      Added value: +"percentilesArguments"
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  4. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

The annotations already provide readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the agent knows this is a safe, non-mutating operation. The description adds valuable behavioral context: it discloses the two computation methods (nearest-rank and linear interpolation) and warns about the n < 100 caveat for p99, which is not implied by annotations. However, it does not describe the return format or whether the output is a map or array, but given the annotations cover safety and idempotency, a slight deduction is fair.

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, using three focused sentences. It front-loads the core purpose and method, then immediately provides sibling differentiationassador, and ends with a crucial caveat. Every sentence adds substantive information without redundancy. The structure is logical: purpose first, comparison second, warning last.

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?

Given a single parameter fully documented in the schema, an output schema exists to describe return values, and annotations cover safety and idempotency, the description is nearly complete. The main missing piece is a clear note on the output format (e.g., a dictionary with both interpolation methods), but the output schema presumably handles that. The description effectively covers the tool's scope, usage, and a key limitation, making it well-rounded.

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 schema description coverage is 100%, so the parameter 'nums' is already well-described in the schema as 'Sample of numbers to compute p50/p90/p95/p99 for, by nearest-rank and linear interpolation.' The description reiterates the same information without adding new details like accepted ranges (e.g., must be non-empty, can contain floats) or edge cases. Thus, it adds minimal value beyond the schema, earning the baseline 3.

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 computes p50/p90/p95/p99 percentiles using both nearest-rank and linear interpolation methods for a given sample. It explicitly names the resource ('percentile cutoffs') and the verb ('computes'), making the purpose unambiguous. The inclusion of the specific percentiles (50th/90th/95th/99th) further distinguishes it from generic statistical tools.

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 explicitly pairs the tool with calc_stats, clarifying when to use each: use percentiles for distribution points, use calc_stats for mean/median/stdev/CV. This direct comparison gives clear usage guidance and prevents confusion among siblings. It also warns about the n < 100 case, advising caution when interpreting p99 as the maximum, which helps the agent decide if this tool is appropriate.

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