Skip to main content
Glama
Jambozx

OnlineCyberTools MCP (280+ filterable tools)

by Jambozx

math_gcd_lcm_calculator

Read-onlyIdempotent

Compute GCD and LCM of integers with all reduction steps, or prime-factorize a number into prime-exponent pairs.

Instructions

GCD / LCM Calculator and Prime Factorizer. Compute the greatest common divisor (GCD) and least common multiple (LCM) of a list of integers, or prime-factorize a single integer. GCD/LCM use the pairwise Euclidean algorithm (BigInt-backed so LCM never overflows) and return every reduction step; factorize uses trial division and returns prime/exponent pairs plus a pretty string. Set operation to gcd, lcm, or factorize. Use this for number-theory reductions; use math_prime_number_checker for primality/next-prime, math_factorial_calculator for n!/nPr/nCr, and math_bitwise_calculator for bit operations. Runs locally on the numbers you provide: read-only, non-destructive, contacts no external service, and is rate-limited (60 requests/minute for anonymous callers). Returns the result value plus the worked steps (GCD/LCM) or factor list (factorize).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationYesWhich computation to run: gcd or lcm (require numbers) or factorize (requires n).
numbersNoRequired for gcd/lcm: 2 to 32 integers. GCD rejects an all-zero list; LCM rejects any zero. String digits like "12" are accepted and coerced.
nNoRequired for factorize: a single integer from 2 to 10^12 (1000000000000) to prime-factorize.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
successNoWhether the computation succeeded.
resultNoOperation output. gcd/lcm/factorize each populate different fields.
errorNoPresent only on failure: the validation/computation error message.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv0.5.1
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / n
      Added value: +{
      +  "description": "Required for factorize: a single integer from 2 to 10^12 (1000000000000) to prime-factorize.",
      +  "maximum": 1000000000000,
      +  "minimum": 2,
      +  "type": "integer"
      +}
    • addedInput schema / properties / numbers / description
      Added value: +"Required for gcd/lcm: 2 to 32 integers. GCD rejects an all-zero list; LCM rejects any zero. String digits like \"12\" are accepted and coerced."
    • addedInput schema / properties / numbers / maxItems
      Added value: +32
    • addedInput schema / properties / numbers / minItems
      Added value: +2
    • addedInput schema / properties / operation / description
      Added value: +"Which computation to run: gcd or lcm (require numbers) or factorize (requires n)."
    • addedInput schema / properties / operation / enum
      Added value: +[
      +  "gcd",
      +  "lcm",
      +  "factorize"
      +]
    • changedInput schema / required
      Previous value: -[
      -  "operation",
      -  "numbers"
      -]New value: +[
      +  "operation"
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "error": {
      +      "description": "Present only on failure: the validation/computation error message.",
      +      "type": "string"
      +    },
      +    "result": {
      +      "description": "Operation output. gcd/lcm/factorize each populate different fields.",
      +      "properties": {
      +        "bigInt": {
      +          "description": "lcm only: true when the LCM exceeded 2^53-1 and is returned as a string.",
      +          "type": "boolean"
      +        },
      +        "factors": {
      +          "description": "factorize: prime-power factors in ascending prime order.",
      +          "items": {
      +            "properties": {
      +              "exponent": {
      +                "description": "Its multiplicity.",
      +                "type": "integer"
      +              },
      +              "prime": {
      +                "description": "A prime factor.",
      +                "type": "integer"
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "gcd": {
      +          "description": "gcd: the greatest common divisor. lcm: also the overall GCD. Integer, or a decimal string when it exceeds 2^53-1."
      +        },
      +        "lcm": {
      +          "description": "lcm: the least common multiple - an integer, or a decimal string when it exceeds 2^53-1."
      +        },
      +        "n": {
      +          "description": "factorize: the integer that was factored.",
      +          "type": "integer"
      +        },
      +        "numbers": {
      +          "description": "gcd/lcm: the normalized input integers, echoed back.",
      +          "items": {
      +            "type": "integer"
      +          },
      +          "type": "array"
      +        },
      +        "pretty": {
      +          "description": "factorize: human-readable factorization, e.g. 2^2 x 3 x 5.",
      +          "type": "string"
      +        },
      +        "steps": {
      +          "description": "gcd: Euclidean steps {a,b,q,r}. lcm: pairwise steps {a,b,gcd,lcm} (values may be strings when large).",
      +          "items": {
      +            "type": "object"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "success": {
      +      "description": "Whether the computation succeeded.",
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true. The description adds algorithmic details (Euclidean algorithm, trial division, BigInt), confirms local execution with no external service, and specifies rate limits (60 req/min). No contradictions.

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 a single, focused paragraph that front-loads the core function. It efficiently covers purpose, usage, and behavior without waste. Could be slightly tighter but is well-structured.

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

Completeness5/5

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

Given the presence of an output schema, the description need not detail return values, yet it still mentions return structure. It covers algorithms, rate limits, local execution, and parameter requirements, making it fully informative for an agent.

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 100% with descriptions for all parameters. The description adds minor context (string coercion for 'numbers', algorithm notes) but largely restates schema info. Minimal additional value beyond schema, so baseline 3.

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 identifies the tool as a GCD/LCM calculator and prime factorizer. It specifies the operations (gcd, lcm, factorize) and distinguishes from siblings like math_prime_number_checker, math_factorial_calculator, and math_bitwise_calculator, leaving no ambiguity about its purpose.

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?

Explicitly states when to use the tool ('for number-theory reductions') and when not to, with named alternative tools. Also mentions rate-limiting and local execution, providing clear usage context.

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

Deploy Server

Other Tools