Skip to main content
Glama

crypto.modpow

Read-onlyIdempotent

Computes modular exponentiation (base^exponent mod modulus) from integer strings, returning the residue as an integer string for cryptographic and modular arithmetic calculations.

Instructions

모듈러 거듭제곱 base^exponent mod modulus 를 구한다. 세 인자는 정수 문자열(자릿수 한도 2048)이며 modulus 는 1 이상, exponent 는 0 이상이어야 한다. result 는 0 이상 modulus 미만의 정수 문자열이다. 음수 지수로 역원을 구하려면 modinv 를 쓴다.

Input Schema

NameRequiredDescriptionDefault
baseYes
modulusYes
exponentYes

Output Schema

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

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?

The annotations already establish that the operation is a read-only, idempotent, non-open-world function, so the safety profile is covered. The description adds constraints beyond the annotations: a 2048-digit limit per argument, modulus >= 1, exponent >= 0, and a guaranteed result range of [0, modulus). This is meaningful context, but it does not describe error behavior when the digit limit or the domain constraints are violated.

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?

The description is four sentences, ordered from purpose to input format, output range, and alternative. Every sentence adds new information with no restatement of the tool name or title.

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?

An output schema exists, and the description still usefully gives the result domain; the input format and limits fully cover a 3-required-parameter tool. It is nearly complete and lacks only error or failure behavior for out-of-range inputs, which is minor.

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 description coverage is 0%, so the description must carry the burden, and it does: it declares that all three arguments are integer strings, imposes a 2048-digit limit, and gives per-argument domain constraints (modulus >= 1, exponent >= 0). It does not separately explain what base or exponent means beyond their names, which are self-describing, so a 4 rather than a 5 is appropriate.

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 names a precise mathematical operation and spells out the exact formula (base^exponent mod modulus), so the agent knows exactly what is computed without opening the schema. It also distinguishes itself from crypto.modinv by assigning negative-exponent inverse operations to that sibling.

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?

The final sentence gives an explicit exclusion plus the alternative tool ('for inverse with negative exponent, use modinv'), which directly disambiguates it from the closest sibling. It does not discuss broader routing versus other modular-arithmetic siblings such as crypto.crt or crypto.egcd, but that absence is minor for a pure function.

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