Skip to main content
Glama
AbderY
by AbderY

is_prime

Check whether a given integer is prime using trial division up to its square root; values below 2 are not prime.

Instructions

Return whether the integer n is a prime number.

Uses trial division up to sqrt(n). Values below 2 are not prime.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose meaningful behavioral traits: the algorithm ('trial division up to sqrt(n)') and the boundary rule ('values below 2 are not prime'). It implies a pure, side-effect-free computation. It could go further on complexity or negative-number handling, but the added context is solid.

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

Conciseness5/5

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

Three short lines, no filler, and the core purpose is front-loaded ahead of algorithm and edge-case details. Every sentence earns its place.

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-value explanation is unnecessary. For a simple pure predicate the description covers purpose, algorithm, and edge cases adequately; only minor details like complexity or large-input behavior are left unstated.

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?

One parameter exists with 0% schema description coverage, so the schema types it as an integer named 'N' with no further meaning. The description reiterates that it is an integer and adds the domain rule that values below 2 are not prime, which gives partial semantic value beyond the schema.

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 resource ('Return whether the integer n is a prime number'), which is unambiguous and immediately actionable. It does not explicitly differentiate itself from the sibling prime_factorization, though the boolean-vs-factorization distinction is inferable from the wording.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no statement of when to use this tool versus alternatives such as prime_factorization or gcd_lcm. For a primality predicate the use case is intuitive, but the description provides no explicit routing guidance or exclusions.

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