Skip to main content
Glama
IBM

MCP Math Server

by IBM

wilson_theorem_check

Check if a number is prime using Wilson's theorem by verifying if (p-1)! ≡ -1 (mod p). This primality test tool determines prime status mathematically.

Instructions

Check Wilson's theorem: p is prime iff (p-1)! ≡ -1 (mod p). (Domain: arithmetic, Category: primality_tests)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nYes
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it states what the tool does mathematically, it doesn't describe important behavioral aspects: what input range is valid (e.g., does it handle negative numbers, zero, or very large integers?), what happens with invalid inputs, whether there are computational limitations, or what the output format will be. The description is mathematically correct but operationally incomplete.

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 efficiently structured in a single sentence that states the theorem and includes domain/category metadata. Every element serves a purpose: the mathematical statement defines the operation, while the parenthetical metadata provides categorization. There's no wasted verbiage, though it could benefit from slightly more operational context.

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?

Given the complexity of a mathematical verification tool with no annotations, no output schema, and minimal parameter documentation, the description is insufficient. It provides the mathematical theorem but lacks crucial operational details: expected input behavior, output format, computational characteristics, and guidance on when this specific primality test is appropriate versus alternatives. The mathematical correctness doesn't compensate for these practical gaps.

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

Parameters2/5

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

The input schema has 0% description coverage, providing only that parameter 'n' is an integer. The description adds no information about what 'n' represents (presumably the number to test for primality), valid ranges, or special cases. For a mathematical tool where parameter semantics are crucial, this represents a significant gap in documentation.

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 explicitly states the tool's purpose: 'Check Wilson's theorem: p is prime iff (p-1)! ≡ -1 (mod p).' It specifies the exact mathematical operation (checking primality using Wilson's theorem) and distinguishes itself from sibling tools like 'is_prime' or other primality tests by focusing specifically on Wilson's theorem verification.

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?

The description provides minimal guidance: it mentions the domain (arithmetic) and category (primality_tests), but offers no explicit advice on when to use this tool versus alternatives like 'is_prime', 'fermat_primality_test', or 'miller_rabin_test'. There's no mention of performance characteristics, accuracy considerations, or typical use cases for Wilson's theorem versus other primality tests.

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