Skip to main content
Glama
AbderY
by AbderY

prime_factorization

Factor any positive integer into its prime components, returning each prime and exponent. Use it to break numbers into prime powers for math, cryptography, or simplification tasks.

Instructions

Return the prime factorization of a positive integer n.

The result is a list of {"prime": p, "exponent": k} entries, ordered by prime. prime_factorization(360) -> 2^3 * 3^2 * 5^1.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

No annotations, so the description carries the burden. It discloses the return format ('list of {"prime": p, "exponent": k} entries, ordered by prime') and provides a concrete example (prime_factorization(360) -> 2^3 * 3^2 * 5^1). This is good behavioral context. It doesn't mention error handling for non-positive n, but the domain restriction is stated.

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?

Two sentences plus an example. Front-loaded: what it does, then the return format, then a concrete example. Zero waste.

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?

For a simple, well-understood math operation with one parameter, the description is nearly complete. It covers purpose, input, output format, and example. An output schema exists, but the description's return format detail is still helpful. The only minor gap is explicit error behavior for invalid inputs.

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

Parameters4/5

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

Schema coverage is 0%, and there is only 1 parameter. The description adds meaning: it specifies the parameter must be a positive integer and names it n. Baseline for 0 params is 4, but here there is 1 param; the description compensates for the schema's lack of description by clarifying the domain.

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?

Specific verb+resource: 'Return the prime factorization of a positive integer n.' This is precise and distinguishes itself from siblings like is_prime (primality test) and factor_expression (symbolic factoring). An agent can select this unambiguously.

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?

Implied usage: prime factorization is a well-known operation, and the description specifies input domain ('positive integer'), which implicitly excludes non-positive integers. However, it offers no explicit guidance on when to use this vs. siblings like is_prime or factor_expression.

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