Skip to main content
Glama

Binary-reflected Gray code

bpj_binary_gray_code
Read-onlyIdempotent

Generate a reflected Gray code by XORing adjacent bits of a nonnegative integer.

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": {
      "integer": "<integer>",
      "bits": "<bits>"
    },
    "name": "bpj_binary_gray_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
bitsYes
integerYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

C2.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and closed-world behavior, so the safety profile is well covered. The description adds the computation method, but says nothing about the return format (e.g., fixed-width bit string), error behavior for oversized or non-numeric input, or how width interacts with leading zeros.

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 front-loaded sentence with no filler, and the algorithm is stated early. The economy comes at the cost of detail rather than verbosity, so no trimming is needed.

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

Completeness2/5

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

For a two-parameter computational tool with no output schema, the description should at minimum describe the shape of the returned code and the role of the bit width. Those essentials are absent, so an agent could call it correctly but cannot predict the output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/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 for two required parameters, yet it only alludes to the integer being "nonnegative." It never explains that the integer is supplied as a decimal string (max 25 chars) or what the required bit width does to the result, leaving both parameters largely undefined.

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?

States a specific verb and resource ("Generate a reflected Gray code") and even names the algorithm (XORing adjacent bits of a nonnegative integer), so the transformation is unambiguous. It stops short of saying what the produced value looks like or naming any distinguishing relation to sibling utilities.

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 when-to-use, when-not-to-use, or alternative guidance at all; the agent must infer that this is a standalone conversion utility to call when a Gray code is wanted. No prerequisites (such as the required bit width relative to the input magnitude) are mentioned.

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.