Skip to main content
Glama
IBM

MCP Math Server

by IBM

tonelli_shanks

Find modular square roots for quadratic congruences x² ≡ a (mod p) using the Tonelli-Shanks algorithm to solve modular arithmetic problems.

Instructions

Solve x² ≡ a (mod p) using Tonelli-Shanks algorithm. (Domain: arithmetic, Category: modular_arithmetic)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYes
pYes
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions the algorithm (Tonelli-Shanks) but does not disclose behavioral traits such as input constraints (e.g., p must be prime, a must be a quadratic residue), performance characteristics, error handling, or output format. This leaves significant gaps for a tool performing a non-trivial mathematical computation.

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 concise and front-loaded with the core purpose in the first sentence. The second sentence adds domain/category context efficiently. However, it could be slightly more informative without sacrificing brevity.

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 the Tonelli-Shanks algorithm, no annotations, no output schema, and low parameter coverage, the description is incomplete. It lacks essential details such as input validation, output format (e.g., returns one or both square roots), and mathematical assumptions, making it inadequate for reliable use.

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?

Schema description coverage is 0%, so the description must compensate. It does not explain the parameters a and p beyond the equation x² ≡ a (mod p). No details are provided on their roles (e.g., a is the quadratic residue, p is the modulus), valid ranges (e.g., p odd prime), or constraints, leaving parameters largely undocumented.

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 clearly states the tool's purpose: 'Solve x² ≡ a (mod p) using Tonelli-Shanks algorithm.' It specifies the exact mathematical operation (solving quadratic congruences), the algorithm used, and distinguishes it from siblings by mentioning its domain (arithmetic) and category (modular_arithmetic), which are unique among the listed tools.

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

Usage Guidelines3/5

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

The description implies usage for solving quadratic congruences modulo a prime, but does not explicitly state when to use this tool versus alternatives (e.g., other modular arithmetic tools like 'is_quadratic_residue' or 'legendre_symbol'). It provides domain/category context, but lacks specific guidance on prerequisites or exclusions.

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