Skip to main content
Glama

Four Squares

four_squares
Read-onlyIdempotent

Four nonnegative integers w <= x <= y <= z with w^2 + x^2 + y^2 + z^2 = n. Every nonnegative integer has one. 7 is 1, 1, 1, 2. n runs from 0 to 1000000. Price: $0.001 USDC per successful call (x402, Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/four-squares

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": {
      "n": "<n>"
    },
    "name": "four_squares"
  }
}

Input Schema

NameRequiredDescriptionDefault
nYes

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 readOnlyHint, idempotentHint, openWorldHint, and destructiveHint=false, so safety behavior is covered. The description adds useful non-annotation context: the input range, the x402 payment model ($0.001 USDC per successful call), and an equivalent HTTPS endpoint.

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 description is compact and front-loads the mathematical definition before the example, range, pricing, and endpoint. The payment and endpoint details are useful rather than wasteful, though the phrasing is terse and not paragraph-structured.

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 one-parameter computation with no output schema, the description is complete enough: it defines the operation, the domain, an example, and the payment/HTTP access path. It does not specify the exact response payload format or out-of-range error behavior, but those gaps are minor for this tool.

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 must carry the burden for the single parameter n. It does so by explaining that n is the target integer and runs from 0 to 1000000, plus giving a concrete example for n=7.

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 description states a precise mathematical operation: find four nonnegative integers w <= x <= y <= z whose squares sum to n. It distinguishes itself from sibling tools like three_squares and two_squares by specifying exactly four squares and giving the ordering constraint.

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 theorem that every nonnegative integer has such a representation, and the example clarifies the output. However, it does not explicitly say when to choose this over siblings such as three_squares, two_squares, or two_squares_pair.

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