Skip to main content
Glama
KonghuanSmart

calculate-mcp

bitwise

Perform bitwise AND, OR, XOR, NOT, shifts, and rotations on 8/16/32/64-bit integers or hex strings. Use it to combine flags, masks, or manipulate binary values.

Instructions

Performs bitwise operations (AND, OR, XOR, NOT, SHL, SHR, SAR, ROL, ROR) with 8/16/32/64-bit width. For several operations or chained steps in one call, use batch_calc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aYesFirst operand (number or hex string like '0x1234')
bNoSecond operand or shift count (not needed for NOT)
bitWidthNoBit width (8, 16, 32, 64; default: 32)
operationYesBitwise operation

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It discloses the supported width domain and operation set, which is useful, but says nothing about edge behavior such as out-of-range shift counts, negative operands, or overflow beyond the declared width.

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?

Two tightly written sentences: the capability and domain come first, the sibling routing second. No filler, nothing to trim.

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 full schema coverage, complete enums, and no output schema to explain, the description covers the essential call contract. Only edge-case semantics are missing, which is a minor gap for a low-risk stateless function.

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 both enums (operation, bitWidth) are documented in the schema, so the schema already carries the parameter detail. The description adds the width set and operation list, but mostly restates what the schema covers, so baseline 3 applies.

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?

States a specific verb (performs bitwise operations) and enumerates the exact operation set and supported widths, which lets an agent distinguish it from arithmetic siblings like multiply or modulo without opening the schema.

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

Usage Guidelines4/5

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

Explicitly routes multi-step or chained work to batch_calc, giving a clear alternative and the condition that selects it. It does not cover when to prefer an arithmetic sibling for single operations, but the primary routing decision is stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.