Skip to main content
Glama

eDiscovery Decoder News/Calc

Calculate Prevalence Or Richness

calculate_prevalence_richness
Read-onlyIdempotent

Estimate how rich or prevalent a population is — the share that is responsive/relevant/positive — from positive hits in a random sample, with a Wilson confidence interval. Use for 'what % of this set is relevant?' or to size review scope and cost expectations. Aggregate counts only; not legal advice.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "positive_hits": "<positive_hits>",
      "sample_size": "<sample_size>"
    },
    "name": "calculate_prevalence_richness"
  }
}

Input Schema

NameRequiredDescriptionDefault
sample_sizeYes
positive_hitsYes
population_sizeNo
confidence_levelNo

Output Schema

NameRequiredDescriptionDefault
formulaYes
sampleSizeYes
positiveHitsYes
pointEstimateYes
confidenceLevelYes
confidenceIntervalYes
estimatedPositiveCountYes
estimatedPositiveLowerYes
estimatedPositiveUpperYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / population_size / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / positive_hits / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / sample_size / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / positiveHits / maximum
      Added value: +9007199254740991
    • addedOutput schema / properties / sampleSize / maximum
      Added value: +9007199254740991
  2. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and non-destructive, so the safety profile is covered; the description adds real behavioral context beyond them — the statistical method (Wilson CI), the requirement that data come from a random sample, that only aggregate counts are involved, and a 'not legal advice' caveat. It doesn't mention edge cases such as zero hits or precision behavior, which is the only remaining gap.

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?

Three short sentences, front-loaded with the core purpose, then usage, then a scope caveat. The 'not legal advice' line is cheap boilerplate but costs almost nothing; no sentence is redundant with the name or schema.

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?

An output schema exists, so return values need not be explained, and for a simple two-number computation the description covers what it computes, why you'd call it, and the aggregate-only nature. The gap is parameter-level: two of four inputs carry no explanation in either the description or the schema.

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?

Schema description coverage is 0%, so the description carries the full burden. It conveys the meaning of positive_hits and sample_size through 'positive hits in a random sample', but population_size is never mentioned (finite-population correction?) and confidence_level is only alluded to via 'Wilson confidence interval', with no indication of the 0.95 default or accepted range.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and statistic ('estimate how rich or prevalent a population is') plus the estimation method ('Wilson confidence interval'), which is more than a restatement of the name. It doesn't name a sibling tool (e.g. calculate_sample_size as its inverse), so differentiation is inferred from function rather than stated.

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?

'Use for "what % of this set is relevant?" or to size review scope and cost expectations' gives concrete use-case context and intent. It also constrains scope with 'Aggregate counts only', but never says when NOT to use it or which sibling to pick instead for related calculations.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources