Skip to main content
Glama

Collision Probability

collision_probability
Read-onlyIdempotent

Determine the birthday-bound collision risk for a given number of items and hash bit width, helping you evaluate whether truncating a hash is safe.

Instructions

Birthday-bound hash collision probability: 1 - exp(-n^2 / (2*2^b)).

Sizes hashes: 1e6 items into 64 bits is ~2.7e-8; 1e5 into 32 bits is ~0.69 — the answer to 'can I truncate this to 8 hex chars?' (no).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bitsYesWidth of the hash in bits, e.g. 32, 64, 128
itemsYesNumber of items being hashed

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.12.0
    • addedInput schema / properties / bits / description
      Added value: +"Width of the hash in bits, e.g. 32, 64, 128"
    • addedInput schema / properties / items / description
      Added value: +"Number of items being hashed"
  2. Changed1 schema field changedv0.11.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "collision_probabilityDictOutput",
      +  "type": "object"
      +}
  3. Changed5 schema fields changedv0.2.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / bits / title
      Added value: +"Bits"
    • addedInput schema / properties / items / title
      Added value: +"Items"
    • addedInput schema / title
      Added value: +"collision_probabilityArguments"
    • 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?

Annotations already establish that the tool is read-only, idempotent, and non-destructive. The description adds the exact formula and examples, so the computation is fully transparent and deterministic with no hidden behavior.

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 compact and front-loaded: a formula, two illustrative examples, and one practical takeaway. Every sentence contributes to understanding 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?

For a simple two-parameter pure calculation tool with strong annotations and an output schema, the formula plus examples fully equip an agent to invoke it correctly. Nothing critical is missing.

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

Parameters4/5

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

The input schema fully documents both parameters, and the description adds meaning by showing how items and bits map into the formula. The concrete examples make parameter semantics vivid and unambiguous.

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 defines the tool's purpose: computing birthday-bound hash collision probability. It includes the exact formula and concrete example outputs, making it easy to distinguish from other numeric or statistical sibling 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 provides a practical use case: deciding whether truncating a hash to a given bit width is safe. It gives clear context for when to use the tool, though it does not explicitly name alternatives or exclusions.

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