Skip to main content
Glama

Collatz conjecture calculator (3n + 1)

hopi_collatz_conjecture_calculator
Read-onlyIdempotent

Run the Collatz (3n + 1) rule on a positive whole number of up to 1,000 digits: halve it when even, treble it and add 1 when odd, until it reaches 1. Returns the total steps, odd and even step counts, the highest value reached and the step it was reached at, and the path itself (first 1,000 values; pathTruncated says whether it was cut). Exact for any size: n, peak and the path values are decimal strings. Pass big numbers as a digit string, because JSON numbers above 9,007,199,254,740,991 lose precision. Source: https://hopi.co.uk/collatz-conjecture-calculator/

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": {
      "n": "<n>"
    },
    "name": "hopi_collatz_conjecture_calculator"
  }
}

Input Schema

NameRequiredDescriptionDefault
nYesStarting number: a positive whole number of up to 1,000 digits, as a digit string such as "27" or "837799" (a plain JSON number also works up to 9,007,199,254,740,991)27

Output Schema

NameRequiredDescriptionDefault
nNo
pathNo
peakNo
stepsNo
summaryYes
oddStepsNo
peakStepNo
evenStepsNo
source_urlYesThe tool's page on hopi.co.uk (cite or open to check the figure)
pathTruncatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, so the safety profile is covered. The description adds substantial behavioral detail beyond that: output fields returned, path truncation at 1,000 values with a pathTruncated flag, and the 9,007,199,254,740,991 JSON precision boundary.

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 front-loaded with the algorithm and the return payload, then the precision caveat, then a source link. It is dense but all content is relevant; there is mild repetition of the digit-string/precision guidance that also appears in the schema.

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 single-input pure-computation tool with annotations and an output schema, the description covers algorithm, input format constraints, numeric limits, and return shape. An agent has everything needed to call it correctly and interpret the result.

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?

Schema coverage is 100% and the single parameter has its own description, so the schema already carries baseline semantics. The description nonetheless adds the reason for the string type (JSON number precision loss above 9,007,199,254,740,991), which is meaning beyond a bare type declaration.

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 states a specific verb and resource ('Run the Collatz (3n + 1) rule on a positive whole number') and spells out the algorithm's two branches and termination condition. No sibling tool in the list computes Collatz sequences, so the scope is unambiguous.

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?

It establishes context for use (any positive integer up to 1,000 digits, exact for any size) and tells the caller to pass a digit string rather than a JSON number. It does not name an alternative tool or state when not to use it, but the tool is the only Collatz implementation in the sibling set, so little routing ambiguity remains.

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