Skip to main content
Glama

number_theory

Read-only

Compute exact integer facts for any size or expression: test primality, factor numbers, list divisors, calculate divisor sums and Euler phi, find previous/next primes, and convert digits across bases 2-36.

Instructions

Integer facts (any size, expressions ok): prime test, factorization, divisors, sigma, phi, prev/next prime, digits, bases 2-36.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "n": "<n>"
    },
    "name": "number_theory"
  }
}

Input Schema

NameRequiredDescriptionDefault
nYes
baseNoalso show in base
from_baseNoparse n in base

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.2

TDQS

B3.2/5.0
Behavior3/5

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

The readOnlyHint annotation already establishes this is a safe read, so the description's added context is limited to 'any size' and 'expressions ok', which are genuinely useful behavioral facts. It says nothing about output shape, performance for very large integers, or what happens when an expression fails to evaluate.

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?

One dense, front-loaded sentence with no filler; the capability list is packed into a compact parenthetical. It borders on being a feature dump, but every clause carries information.

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

Completeness3/5

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

With no output schema and no operation selector in the input schema, the description is the only place a caller could learn how to request a specific fact, and it does not explain that. It is adequate for understanding the domain but leaves the invocation model underspecified for a multi-operation tool.

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 coverage is 67%, so the schema documents base and from_base reasonably well. The description adds the 2-36 range constraint, which is real added meaning, but it does not clarify the distinction between base (display) and from_base (parse) or what forms 'n' accepts as an expression.

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?

The description names a concrete resource (integer facts) and enumerates the operations it covers: primality, factorization, divisors, sigma, phi, prev/next prime, digits, and base conversion. It is more specific than a tautology, but it never distinguishes itself from the sibling 'calc' or explains how a caller picks one operation over another.

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 when-to-use guidance, no statement of when to prefer this over 'calc', and no explanation of how the caller selects among the many listed operations. The phrase 'expressions ok' implies accepted input but gives no conditions or exclusions.

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