Skip to main content
Glama
IBM

MCP Math Server

by IBM

fermat_primality_test

Test if a number is prime using Fermat's primality test, which applies probabilistic checks with configurable iterations to identify probable primes.

Instructions

Fermat primality test. Simple but can be fooled by Carmichael numbers. (Domain: arithmetic, Category: advanced_primality)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nYes
kNo
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the Carmichael number limitation, which is useful behavioral context about reliability. However, it doesn't describe what the tool returns (likely a boolean or probability), error conditions, performance characteristics, or what the 'k' parameter controls (iterations/confidence). The description adds some value but leaves critical behavioral aspects unspecified.

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?

Extremely concise - just one sentence plus domain/category tags. Every word earns its place: names the algorithm, states a key limitation, and provides classification. However, it's arguably too brief given the complete lack of parameter documentation and behavioral details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a primality testing tool with 2 parameters, 0% schema coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns, how to interpret results, what the parameters mean, or when to use it versus sibling primality tests. The Carmichael number warning is helpful but insufficient for complete understanding.

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

Parameters1/5

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

Schema description coverage is 0%, so the description must compensate. It provides no information about parameters 'n' (the number to test) or 'k' (likely iterations/confidence level with default 10). The description doesn't mention parameters at all, leaving them completely undocumented beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Fermat primality test' which names the algorithm, but it doesn't specify what the tool actually does (test if a number is prime using Fermat's method). It mentions 'can be fooled by Carmichael numbers' which is a limitation, not the purpose. The domain/category tags add context but don't define the tool's function.

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?

No explicit guidance on when to use this tool versus alternatives. The mention of Carmichael numbers implies a limitation, but doesn't specify when to choose this over other primality tests (like 'aks_primality_test', 'miller_rabin_test', or 'deterministic_miller_rabin' which are sibling tools). No prerequisites or context for usage are provided.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/IBM/chuk-mcp-math-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server