Skip to main content
Glama

ScorpTech x402 Tools

Josephus

josephus
Read-onlyIdempotent

The surviving seat in the Josephus circle. Seats are 1 through n, counting starts at 1, and every k-th remaining person leaves. 5 people and every 2nd leave seat 3. 41 people and every 3rd leave seat 31. n and k run from 1 to 10000. Returns JSON with: n, k, value. Price: $0.001 USDC per successful call (x402, Base or Solana). Same tool over HTTPS: POST https://scorptech.it.com/api/x402/v1/josephus

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>",
      "k": "<k>"
    },
    "name": "josephus"
  }
}

Input Schema

NameRequiredDescriptionDefault
kYes
nYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, non-destructive), the description discloses the return shape ('JSON with: n, k, value'), a payment requirement ($0.001 USDC per successful call via x402 on Base or Solana), and an alternate HTTPS endpoint. Pricing and payment rail are exactly the kind of context an agent cannot get 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?

Front-loaded with the core definition and immediately backed by disambiguating examples, then operational details (bounds, return shape, price, endpoint). It is dense but nearly every sentence adds information; the single-block prose could be slightly tighter but nothing is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/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 definition covers the operation, the parameter meanings, the valid ranges, the return fields, the cost, and the transport alternative. Nothing an agent needs to invoke it correctly is missing.

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 parameter meaning — and it does: seats are 1 through n, counting starts at 1, and every k-th remaining person leaves. The worked examples resolve edge ambiguities (e.g., whether counting restarts or continues) that raw integer constraints could not. A minor deduction because the exact 1-based indexing of k itself is only implied by the examples.

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 description names a specific computation ('The surviving seat in the Josephus circle') rather than restating the tool name, and the two worked examples (5/2 → seat 3, 41/3 → seat 31) pin down the exact mathematical operation. It does not explicitly distinguish itself from siblings like josephus_order or josephus_place, which is the only gap.

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 rather than stated: the agent must infer from 'surviving seat' that this returns the last survivor, and there is no explicit guidance on when to pick this over the various other josephus_* variants. The stated input ranges (n and k from 1 to 10000) and the cost per call give useful operational boundary conditions.

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