Skip to main content
Glama

Mod Inv

mod_inv
Read-onlyIdempotent

The modular inverse of a modulo m, as a residue from 0 up to m-1. The modulus must be at least 1. A value that is not coprime to m is rejected. Price: $0.001 USDC per successful call (x402, Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/mod-inv

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>",
      "mod": "<mod>"
    },
    "name": "mod_inv"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYes
modYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover the read-only/idempotent/non-destructive profile, and the description adds genuinely new behavioral context: the rejection of non-coprime inputs, the residue range of the result, the modulus >= 1 constraint, and a required paid x402/USDC authorization per successful call. That payment/auth requirement is important operational context absent from the annotations.

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 core definition is front-loaded in the first sentence, and subsequent sentences add distinct, non-redundant facts (domain constraint, failure mode, cost, HTTPS fallback). The pricing/endpoint sentence is ancillary but still useful operational information rather than padding.

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?

With no output schema, the description correctly states the return form ('a residue from 0 up to m-1') and the failure condition, which is what an agent needs to call and interpret it. The remaining gap is routing confusion with the near-identical sibling 'mod_inverse', which the description never addresses.

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 carry the load. It does map the parameters to their mathematical roles ('a modulo m') and constrains the modulus to >= 1, but it says nothing about the string-encoding of a and m or the 200-digit magnitude limit, leaving the pattern-based representation undocumented in prose.

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 mathematical operation with a named verb+resource ('modular inverse of a modulo m'), which is far more than a restatement of the name. It does not, however, differentiate itself from the very similar sibling tool 'mod_inverse' (nor from 'power_mod'/'egcd'), so an agent cannot tell which one to pick without opening both schemas.

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 preconditions given ('the modulus must be at least 1', 'a value that is not coprime to m is rejected'), which tell the agent when the call will fail but not when to choose this tool over 'mod_inverse'. No explicit alternatives or exclusions are named.

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.

Resources