Skip to main content
Glama

ScorpTech x402 Tools

Mod Inverse

mod_inverse
Read-onlyIdempotent

The inverse of a modulo m, the residue from 0 to m-1 with a*inverse = 1 mod m. The inverse of 3 mod 7 is 5, and the inverse of -1 mod 7 is 6. There is no inverse when a and m share a factor. m runs from 2 to 1000000000000. Returns JSON with: a, m, value. Price: $0.001 USDC per successful call (x402, Base or Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/mod-inverse

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>",
      "m": "<m>"
    },
    "name": "mod_inverse"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYes
mYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, so the safety profile is covered. The description adds real behavior beyond that: the non-invertibility condition when gcd(a,m)>1, the m domain bound of 2 to 1000000000000, the return shape (a, m, value), pricing, and an alternate HTTPS endpoint. It stops short of saying what the tool actually returns or raises when no inverse exists, which is the one behavior an agent must handle.

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?

Front-loaded with the definition, then examples, then edge case, then output and access details — a sensible order with no filler. The two worked examples are the only borderline element, but they earn their place by demonstrating negative-input normalization.

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 two-parameter pure-computation tool with no output schema, the description supplies the result semantics, the non-invertibility condition, the numeric domain, and the return fields, so an agent can call it and interpret a success. The gap is the failure mode: it does not say whether a non-invertible input yields an error, a null value, or a charged failed call — relevant given the stated per-successful-call price.

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 carries the burden. It establishes that 'a' is the value being inverted and 'm' is the modulus, fixes m's lower bound at 2, and the worked example '-1 mod 7 is 6' reveals that negative 'a' values are normalized rather than rejected — non-obvious semantics the schema's bare min/max does not convey.

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?

States a specific mathematical operation with its exact definition: 'the residue from 0 to m-1 with a*inverse = 1 mod m'. An agent knows precisely what is computed and what range the result falls in, which is more than the name alone conveys.

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 implied by the mathematical definition and the 'no inverse when a and m share a factor' precondition, but there is no explicit when-to-use guidance and no differentiation from the sibling 'mod_inv' or 'mod_pow', which an agent would reasonably confuse with this tool. The applicability is inferable rather than stated.

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