Skip to main content
Glama

Prime number tools

calc_primes
Read-onlyIdempotent

Check primality, factor large integers, compute divisors, Euler φ, GCD/LCM, and list primes in a range from expressions up to 400 digits.

Instructions

Number theory with big integers, like the website. check: is a number prime (trial division, deterministic Miller-Rabin below 2^64, probabilistic above), its prime factorisation (Pollard rho), number of divisors, sum of divisors σ, Euler φ, the divisor list, previous/next prime and whether it is perfect; the number may be an expression like "2^61-1", "10!+1" or "1000003*1000033" (up to 400 digits). gcd_lcm: GCD and LCM of 2–50 numbers with Euclid's steps. range: list the primes between two numbers (below 10^15, at most 10,000,000 numbers per range). Web version: https://s3eidat.github.io/prime-tools/

Input Schema

NameRequiredDescriptionDefault
toNorange: end (inclusive), below 10^15.
fromNorange: start (inclusive).
modeNoWhat to do.check
limitNorange: return at most this many primes in the list (the count is always exact).
numberNocheck: the number or expression, e.g. "600851475143" or "2^89-1".
numbersNogcd_lcm: the whole numbers (2–50, expressions allowed).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/closed-world, and the description adds meaningful behavioral context beyond that: deterministic Miller-Rabin below 2^64 but probabilistic above, Pollard rho for factorisation, and hard input limits. The probabilistic-result caveat is exactly the kind of correctness detail an agent needs and cannot get from annotations.

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?

It is front-loaded with the overarching purpose and then structured by mode, and nearly every clause carries information. It is a dense single paragraph and the trailing website URL plus 'like the website' are marginal, but there is little true filler.

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?

For a six-parameter, three-mode tool with no output schema, the description covers the mode semantics and hard limits well. It does not describe the shape of returned results (e.g., factorisation format or how gcd steps are returned), which would matter without an output schema, so it falls short of a 5.

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%, so the baseline is 3, but the description adds real semantics: check accepts expressions like '2^61-1' or '10!+1' up to 400 digits, gcd_lcm takes 2–50 numbers, and range is bounded below 10^15. It omits the 'limit' parameter's 100,000 cap and exact-count behavior, so not a 5.

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 names the resource ('number theory with big integers') and enumerates the three modes and exactly what each computes: primality, factorisation, divisor counts/sums, φ, prev/next prime, perfect, gcd/lcm, and prime ranges. This lets an agent distinguish it from siblings like calc_expression or calc_fraction without opening the schema.

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 mode list clearly implies when each mode applies, and it names constraints (400-digit expressions, ranges below 10^15, 2–50 numbers for gcd_lcm, max 10,000,000 numbers per range). It does not explicitly name alternatives or exclusions (e.g., use calc_expression for plain arithmetic), which is the one missing piece.

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

Deploy Server

Other Tools