Skip to main content
Glama

Evaluate a programmer expression

calculate_programmer
Read-onlyIdempotent

Evaluate integer expressions with C-like precedence (hex/octal/binary literals, bitwise ops, shifts) and report base conversions plus signed/unsigned interpretations.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "calculate_programmer"
  }
}

Input Schema

NameRequiredDescriptionDefault
aNoFirst operand, e.g. '0xFF' or '255'
bNoSecond operand (not needed for 'not')
opNoBitwise operation (alternative to expression)
bitsNoBit width for masking and signed interpretation64
expressionNoInteger expression, e.g. '0xFF & 0x0F | (1 << 4)'

Output Schema

NameRequiredDescriptionDefault
hexYes
bitsYes
octalYes
binaryYes
signedYes
decimalYes
unsignedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already establish readOnlyHint, idempotentHint and openWorldHint=false, so safety and idempotence are covered. The description adds genuine behavior beyond that: it discloses the evaluation semantics (C-like precedence), accepted literal formats, and what the result contains (base conversions, signed and unsigned interpretations). It does not explain masking behavior of the 'bits' parameter or error handling for malformed expressions, which keeps it off a 5.

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?

A single dense sentence with the capability and the output both front-loaded, no filler and no restatement of the title. Every clause (precedence, literal bases, conversions, signedness) carries distinct information.

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?

With an output schema present, the description need not explain return values, and annotations cover the safety profile, so the remaining burden is small. The one material omission is the dual invocation mode: the description only describes the expression path, leaving the a/b/op form and what happens if both are supplied undocumented in prose.

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%, so the schema already documents each parameter including the operand examples and the bit-width enum, making 3 the baseline. The description contributes indirectly by explaining that results carry signed/unsigned interpretations, which hints at the role of 'bits', but it never addresses the 'op'/'a'/'b' structured mode or precedence between 'expression' and the operand parameters.

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 ('Evaluate') and resource ('integer expressions') and enumerates the supported surface: hex/octal/binary literals, bitwise ops, shifts, C-like precedence. It also declares the output value ('base conversions plus signed/unsigned interpretations'), which separates it from numeric siblings like calculate_percentage or calculate_emi. It stops short of naming a sibling or acknowledging the a/b/op parameter mode, so it is clear but not fully differentiated.

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 or when-not-to-use guidance at all — no statement of which sibling to pick for unit conversion or percentage math, and no guidance on choosing between the free-form 'expression' path and the structured a/b/op path. The agent must infer the mode choice from the schema alone.

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.