Skip to main content
Glama

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. Price: $0.001 USDC per successful call (x402, 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.7/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, open-world), so the description's added value is real: it discloses that 0 counts as a square, that p must be an odd prime, and that each successful call costs $0.001 USDC via x402 on Solana with an HTTPS mirror. Cost and payment requirement are behavioral traits annotations cannot express, though the return shape and failure behavior are not described.

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 definition leads with the semantic core, then adds two compact worked examples and the precondition before the commercial details. Every clause carries information; the pricing sentence is long but is legitimately needed for an x402-metered endpoint.

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-integer predicate with no output schema, the description supplies the definition, edge-case convention (0 counts as a square), domain constraint on p, cost, and an alternate transport. The remaining gap is that it never states the return value is a boolean verdict rather than, say, a symbol, leaving the agent to infer it.

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 full burden and does only partly: it establishes that 'a' is the value tested (including negative values, per the -1 examples) and that 'p' is an odd prime modulus. That is meaningful compensation, but the advertised ranges (a in ±1e12, p from 0) and the behavior for out-of-domain p are left undocumented.

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 first sentence names a specific mathematical predicate over two named inputs ('whether a is a square modulo an odd prime p'), which is unambiguous and distinct from most siblings. It does not, however, differentiate itself from closely related siblings like legendre_symbol, jacobi, or isquare, so the agent gets no explicit routing signal.

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 one hard precondition ('p must be an odd prime'), plus the payment/transport context, which is genuine usage guidance. But it never says when to prefer this over the near-equivalent legendre_symbol or jacobi tools, and there is no guidance on what happens if p is not an odd prime or is out of range.

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