Skip to main content
Glama

crypto.modinv

Read-onlyIdempotent

Computes the modular inverse of an integer a modulo m, returning a value in [0, m) or an error when gcd(a, m) is not 1.

Instructions

모듈러 역원 a^-1 mod m 을 구한다. a, m 은 정수 문자열(자릿수 한도 2048)이고 m 은 2 이상이어야 한다. result 는 0 이상 m 미만이며, gcd(a, m) 이 1 이 아니면 역원이 없어 오류가 난다. a 가 0 이거나 m 과 약수를 공유하면 역원이 없다.

Input Schema

NameRequiredDescriptionDefault
aYes
mYes

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

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, openWorldHint=false, and idempotentHint=true, so the safety profile is covered. The description adds useful behavioral details beyond annotations: the 2048-digit limit, m >= 2 requirement, result range 0 <= result < m, and specific error conditions when gcd(a,m) != 1 or a is 0.

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 short and front-loads the core operation before constraints and error behavior. The final sentence partially restates the gcd condition already covered earlier, which is a minor redundancy but not harmful.

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 annotations cover the safety profile, so the description need not explain return values or read-only behavior. It provides the key input constraints, error conditions, and result bounds needed to call the tool correctly, with only sibling-routing guidance missing.

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 parameter meaning, and it does: both a and m are integer strings with a 2048-digit limit, and m must be at least 2. It also clarifies the result range and the gcd precondition that governs whether a has an inverse, though edge cases such as negative a are not explicitly addressed.

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 states a specific verb and mathematical resource: it computes the modular inverse a^-1 mod m. This is clear and distinct from siblings such as crypto.modpow or crypto.egcd, though it does not explicitly name alternatives to reinforce the distinction.

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?

The description gives mathematical preconditions (m >= 2, gcd(a,m)=1) but does not explain when to choose this tool over related siblings like crypto.modpow or crypto.egcd. There is no explicit when-to-use or when-not-to-use guidance beyond the validity conditions.

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