Skip to main content
Glama

crypto.euler_totient

Read-onlyIdempotent

Calculate Euler's totient and prime factorization for an integer up to 10^14; returns φ(n) as a string and a prime-to-exponent map, rejecting inputs beyond the limit.

Instructions

오일러 토션트 φ(n) = n * Π(1 - 1/p) 를 구한다. n 은 1 이상 10^14 이하의 정수 문자열이며 시행 나눗셈으로 소인수분해하므로 한도를 넘으면 오류다. phi 는 정수 문자열, factorization 은 소수 문자열을 지수에 대응시킨 맵이다. RSA 크기의 수에는 쓸 수 없다.

Input Schema

NameRequiredDescriptionDefault
nYes

Output Schema

NameRequiredDescriptionDefault
phiYes
_metaNo서버가 붙이는 영수증(integrity), 엔진, 힌트
traceYes계산 근거(tool, formula, inputs, steps, output)
factorizationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already carry readOnly, idempotent and closed-world hints, yet the description adds real behavioral context: trial-division factoring, an error when n exceeds the limit, and the shape of the result. The note that it is unusable at RSA scale is exactly the kind of non-obvious caveat annotations cannot express.

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?

Four dense sentences: the formula and purpose first, then input constraint, then output shape, then the practical limitation. No filler and the most decision-relevant information is front-loaded.

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?

For a single-parameter read-only math tool, the description covers purpose, valid input domain, failure mode, return structure and a practical limitation. The output schema exists, but the extra explanation of phi and the factorization map costs nothing and adds clarity.

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% – the schema only says 'n: string'. The description fully compensates by specifying that n is an integer string, its inclusive bounds 1 to 10^14, and that out-of-range input is an error.

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 specific verb and resource ('오일러 토션트 φ(n) = n * Π(1 - 1/p) 를 구한다'), giving the exact function and its formula. It does not explicitly differentiate itself from its closest sibling, crypto.carmichael_lambda, but the formula itself makes the distinction unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states a hard input domain (1 ≤ n ≤ 10^14) and an explicit exclusion ('RSA 크기의 수에는 쓸 수 없다'), which effectively tells the agent when not to call it. It stops short of naming an alternative tool for the large-number case, so the routing is implied rather than complete.

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