Skip to main content
Glama

ScorpTech x402 Tools

Quadratic Residue

quadratic_residue
Read-onlyIdempotent

Whether a is a square modulo an odd prime p, counting 0 as a square. 2 is a square mod 7, and 3 is not. -1 is a square mod 5 and not mod 7. p must be an odd prime. Returns JSON with: a, p, value. Price: $0.001 USDC per successful call (x402, Base or Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/quadratic-residue

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>",
      "p": "<p>"
    },
    "name": "quadratic_residue"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYes
pYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive behavior, and the description adds genuinely new context: a per-call price ($0.001 USDC via x402 on Base or Solana) and an equivalent HTTPS endpoint. It also discloses the response keys (a, p, value), though it leaves the meaning of 'value' unexplained.

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?

It is front-loaded with the core question, then examples, then constraints, then return shape and price — a sensible order with no filler. The 'p must be an odd prime' requirement is stated twice, which is minor redundancy in an otherwise tight definition.

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 math predicate with no output schema, the definition covers the domain constraint, illustrative cases, output key names, payment model, and an alternate transport. The only meaningful gap is that 'value' is not characterized (boolean vs 1/0 vs a Legendre symbol indicator), which an agent needs to interpret the result.

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 does narrow p to odd primes while the schema permits 0 through 1e12, which is real added meaning, but it says nothing about the meaning or effect of negative values of a (beyond an example) or the bounds on either parameter.

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?

The opening clause names the exact computation: whether a is a square modulo an odd prime p, with the convention that 0 counts as a square. Two worked examples (2 mod 7 is a square, 3 mod 7 is not; -1 mod 5 vs mod 7) pin down the semantics, and no sibling in the list performs this same operation.

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?

The description states the domain precondition that p must be an odd prime (repeated for emphasis), which is the main gate for correct invocation. It gives no explicit when-to-use-this-vs-alternative framing, but for a narrow, single-purpose number-theory predicate there is little alternative to route to.

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