Skip to main content
Glama

¿Es número primo?

is-prime
Read-onlyIdempotent

Prueba la primalidad con Miller-Rabin determinista hasta 3,3·10^24 y devuelve los primos siguiente y anterior. Cuándo: un resultado numérico tiene que ser exacto o reproducible y no estimado. No para: factorizar un entero (prime-factorize). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Tests primality with deterministic Miller-Rabin for integers up to 3.3·10^24 (number or decimal string) and returns the next and previous primes. When: a numeric result has to be exact or reproducible instead of estimated. Not for: factorizing an integer up to 10^20 into primes (prime-factorize). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.

Input Schema

NameRequiredDescriptionDefault
nYesInteger (integer or string; required; up to 25 chars; pattern ^-?\d{1,24}$).

Output Schema

NameRequiredDescriptionDefault
nNo
is_primeNo
next_primeNo
previous_primeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / n / examples
      Added value: +[
      +  97
      +]
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare read-only, non-destructive, idempotent, and closed-world behavior. The description adds deterministic algorithm details, time/input/result limits, and return content; the side-effect sentence is largely redundant with annotations but consistent, not contradictory.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The content is front-loaded and well structured within each language, but the entire description is duplicated in Spanish and English. For a single agent, half the text repeats the same information and does not earn its place.

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 one-parameter tool with an output schema and rich annotations, the description covers purpose, usage, alternatives, determinism, side effects, and operational limits. Nothing essential for correct invocation is missing.

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 coverage is 100%, so the schema already documents the single n parameter. The description adds the mathematical upper bound and accepted number/decimal-string forms, but the stated 3.3e24 bound sits awkwardly against the schema's 24-digit regex pattern, so the added value is limited and slightly risky.

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?

States a specific verb and resource (tests primality), names the deterministic Miller-Rabin algorithm, gives the supported range, and says it returns next/previous primes. It also explicitly distinguishes itself from the sibling prime-factorize.

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?

Provides an explicit 'When' condition (exact/reproducible numeric results instead of estimates) and a 'Not for' condition naming the alternative prime-factorize. The routing decision is clear without opening either schema.

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