Skip to main content
Glama

Bitwise Calculator

calculator_bitwise
Read-only

Bitwise AND, OR, XOR, NOT on integers (Python signed integer semantics for NOT).

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": {
      "operation": "<operation>",
      "a": "<a>"
    },
    "name": "calculator_bitwise"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYesFirst integer (or sole value for NOT).
bNoSecond integer (required except for NOT).
operationYesand|or|xor|not (or &, |, ^, ~).

Output Schema

NameRequiredDescriptionDefault
resultYes
operationNo
expressionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, destructiveHint false, and openWorldHint false, so safety is covered. The description adds real behavioral context by noting Python signed-integer semantics for NOT, which explains negative results; return shape is covered by the output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with zero filler. The operation list is front-loaded, and the NOT semantics caveat is placed immediately after where it matters.

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 pure computation tool with complete schema coverage and an output schema, this covers the purpose and the one non-obvious semantic detail (Python signed NOT). It omits explicit routing to shift or conversion siblings, but nothing prevents correct invocation.

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 100%, and the schema already documents a, b (required except for NOT), and operation aliases. The description only restates the operation set and adds no parameter-level detail beyond the schema.

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?

Names the four bitwise operations and the operand type in a single front-loaded clause. The operation list distinguishes it from calculator_shift (bit shifting) and conversion tools such as calculator_binary.

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 operation list, but there is no explicit when-to-use or when-not-to-use statement. It does not mention calculator_shift for shifts or binary conversion siblings, leaving the agent to infer the boundary.

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.