Skip to main content
Glama

Modular multiplicative inverse

bpj_discrete_modular_inverse
Read-onlyIdempotent

Determine coprimality and return the least nonnegative multiplicative inverse when it exists.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "a": "<a>",
      "modulus": "<modulus>"
    },
    "name": "bpj_discrete_modular_inverse"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYes
modulusYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive, and closed-world, so safety is covered. The description adds one genuinely useful behavioral fact: the inverse is returned only 'when it exists,' implying a coprimality precondition and a distinct non-existence outcome. It does not say whether non-coprimality produces an error, a null, or a flag, which is the remaining ambiguity.

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?

A single compact sentence with no filler, and the primary outcome (the inverse) is stated after the coprimality condition in a logical order. Nothing is padded, though the terseness contributes to the missing usage and failure-mode detail.

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

Completeness3/5

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

With no output schema, the description must describe the return value, and it does: the least nonnegative inverse plus a coprimality determination. What it omits is the shape of the non-existence case and any note on modulus constraints, which matters for a tool whose entire failure mode hinges on gcd(a, modulus) = 1.

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 description coverage is 0%, so the description carries the burden. It clarifies the relationship between the two parameters by framing the operation as a coprimality test between them, which is meaning beyond the bare 'Integer A' and 'Modulus' titles. It still does not state that a and modulus must be coprime for success, nor the bounds (a >= 1, modulus >= 2) that the schema enforces.

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-result pair: determine coprimality and return the least nonnegative multiplicative inverse. An agent immediately knows this is a number-theory computation on two integers. It does not, however, distinguish itself from close siblings such as bpj_discrete_bezout or bpj_discrete_congruence_pair, which likely overlap.

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?

There is no when-to-use or when-not-to-use guidance, and no named alternative. The agent is left to infer that this tool is preferred over a general Bezout or congruence solver when the specific goal is an inverse modulo a modulus. That inference is plausible but unstated.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.