Skip to main content
Glama

Josephus survivor position

bpj_discrete_josephus
Read-onlyIdempotent

Count from the first person and eliminate every kth to obtain the one-based surviving position.

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": {
      "people": "<people>",
      "step": "<step>"
    },
    "name": "bpj_discrete_josephus"
  }
}

Input Schema

NameRequiredDescriptionDefault
stepYes
peopleYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, closed-world and non-destructive, so safety is covered. The description adds genuinely useful behavioral detail about the counting convention and one-based output, which is the main ambiguity in this problem. It does not disclose ties to cost at large inputs or edge cases such as step=1 (everyone eliminated sequentially) or people=1.

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?

A single well-formed sentence with the procedure front-loaded and no filler. It is efficient, though the brevity leaves the schema-only parameters unglossed.

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

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-parameter pure-computation tool with full annotations and no output schema, the description covers the core semantics and even the return-value convention. Missing are parameter-name mapping, counting-resumption convention (next person after an elimination), and edge-case behavior, which matter given 0% schema coverage.

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 must carry parameter meaning; it does so indirectly ('first person' implies people=n, 'every kth' implies step=k). It never names the parameters or states that step is the elimination interval and that starting the count at person 1 versus person 0 changes the answer, so compensation is only partial.

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 states a specific procedure and result: count from the first person, eliminate every kth, return the one-based surviving position. That is enough to identify this as the Josephus-survivor computation and distinguish it from adjacent discrete-math siblings like permutation_rank or binomial. It stops short of naming the problem or explicitly stating that it returns an index into 1..people.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this versus alternatives, no prerequisite or input-validity notes, and no mention of the large-input bounds (people up to 100000, step up to 1000000). Usage is only implied by the one-line procedure.

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.