Skip to main content
Glama

Modular exponentiation

bpj_discrete_modular_power
Read-onlyIdempotent

Use repeated squaring to calculate a large integer power modulo a supplied base modulus.

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>",
      "exponent": "<exponent>",
      "modulus": "<modulus>"
    },
    "name": "bpj_discrete_modular_power"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYes
modulusYes
exponentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, closed-world, non-destructive behavior, so the safety profile is covered. The description adds that repeated squaring is used, which hints at efficient handling of the large (up to 1e9) exponent, but it says nothing about return format or edge-case behavior.

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 front-loaded sentence with no wasted clauses. The only minor cost is the imprecise 'base modulus' wording.

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 pure-function arithmetic tool with no output schema, the description covers the computation adequately and annotations carry the safety profile. A brief note on the returned value or non-coprime behavior would make it complete.

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 must compensate. It does establish the mathematical roles (base, exponent, modulus) but calls the modulus a 'base modulus', which creates ambiguity about which parameter is the base and does not address the bounds or the minimum of 2 on the modulus.

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?

States a specific operation (calculate a large integer power modulo a supplied modulus) with the verb and resource clear enough to distinguish it from siblings like modular_inverse or bezout. The odd phrase 'base modulus' slightly muddies which value is being reduced, but the intent is readable.

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?

Usage is only implied by the mathematical purpose; there is no explicit statement of when to pick this over bpj_discrete_modular_inverse or other discrete-math siblings, and no prerequisites or exclusions are given.

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.