Skip to main content
Glama

math_number_theory

Compute number theory results: factor integers, test primality, find GCD/LCM, list primes, and apply Chinese remainder theorem.

Instructions

数论运算。

value: 整数值或参数,取决于 operation: 因式分解/factor:'1234567890' GCD/LCM:'1234,5678' 素数范围:'2,100' 离散对数:'base,value,modulus' 中国剩余定理:'r1,m1;r2,m2;...' operation: factor — 质因数分解 isprime — 素数判定 nextprime — 下一个素数 prevprime — 前一个素数 totient — 欧拉函数 φ(n) divisors — 所有因子 primitiveroot — 最小原根 gcd — 最大公约数 lcm — 最小公倍数 fibonacci — 第 n 个斐波那契数 bernoulli — 第 n 个伯努利数 npartitions — 整数分拆数 primorial — 素数阶乘(前 n 个素数之积) primepi — ≤ n 的素数个数 prime — 第 n 个素数 primerange — 范围内素数列表(格式 'a,b') crt — 中国剩余定理(格式 'r1,m1;r2,m2;...') legendre — Legendre 符号 (a|p),格式 'a,p' jacobi — Jacobi 符号 (a|n),格式 'a,n'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYes
operationNofactor

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

No annotations are present, so the description should disclose behavioral traits. It only describes input formats and basic functionality, but lacks any mention of error handling, performance characteristics, or limitations. For a tool with many operations, more transparency is needed.

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 relatively long but well-structured: first a line summarizing purpose, then value format rules, then a clear bullet list of operations. It is front-loaded with the purpose. While it could be more concise, the density of information justifies its length.

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 complexity (20 operations, 2 parameters, output schema available), the description covers the input semantics comprehensively. It does not explain return values, but output schema exists. Minor gap: the default value of 'operation' (factor) is not mentioned. Overall, it is nearly complete.

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

Parameters5/5

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

Schema coverage is 0%, so the description must compensate, which it does thoroughly. It explains the 'value' parameter format for each operation (e.g., '1234567890' for factor, '1234,5678' for GCD) and lists all operation options with brief descriptions. This adds essential meaning beyond the schema.

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 it performs number theory operations ('数论运算') and lists 20 specific operations (factor, gcd, etc.). It distinguishes itself from sibling tools like math_calculus or math_eval by focusing exclusively on number theory calculations.

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 guidance on when to use this tool versus siblings. There is no mention of alternatives or contexts where other math tools would be preferred. The description only lists operations without usage heuristics.

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/3aKHP/math-mcp'

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