Skip to main content
Glama

number_theory_operation

Test primality, factor integers, find the next prime, and compute gcd or lcm for large integers.

Instructions

Number theory: primality testing, integer factorisation, the next prime above n, gcd and lcm. Prefer this over evaluate_sage for any of these.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYesPrimary integer. Pass values above 2^53 as a decimal STRING: JSON numbers are IEEE doubles in JavaScript-based clients, so 10^30 arrives as 1000000000000000019884624838656 and the answer is silently wrong.
bNoSecond integer, required for gcd and lcm. Same string rule.
sessionNoNamed workspace to use. Workspaces have independent variables; omit for 'default'.default
operationYesOperation: 'is_prime', 'factor_integer', 'next_prime', 'gcd', 'lcm'

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

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

No annotations are provided, so the description carries full responsibility for behavioral disclosure. It lists operations but says nothing about side effects, return behavior, error handling, or performance characteristics. The only non-schema behavior mentioned is the routing preference over evaluate_sage.

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?

The description is two sentences, front-loaded with the operation list and ending with an actionable routing note. Every sentence earns its place; there is no redundancy or filler.

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?

Given the rich input schema (100% coverage) and presence of an output schema, the description does not need to explain return values. It provides the core scope and routing context. Adding examples or output shape notes would improve it, but it is adequate for the tool's complexity.

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 description coverage is 100%, with detailed descriptions for parameters including the string rule for large integers and session defaults. The description itself adds no parameter-level semantics, but the schema already provides the needed detail, so a baseline score of 3 is appropriate.

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 names the domain ('Number theory') and enumerates the exact operations: primality testing, integer factorisation, next prime, gcd, and lcm. It also distinguishes the tool from a sibling ('Prefer this over evaluate_sage') by naming the alternative.

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?

It gives a direct usage directive: 'Prefer this over evaluate_sage for any of these.' This tells the agent when to select this tool instead of a named alternative, satisfying the when/alternative requirement even if other siblings are not mentioned.

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/XBP-Europe/sagemath-mcp'

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