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.

Input Schema

TableJSON 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

TableJSON Schema
NameRequiredDescriptionDefault
hexYes
bitsYes
octalYes
binaryYes
signedYes
decimalYes
unsignedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false, so the safety profile is covered. The description adds real behavioral context (C-like operator precedence, literal formats, masking and signed/unsigned interpretation), but with an output schema present the 'reports base conversions' sentence largely restates the return contract rather than disclosing new behavior.

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 zero filler, front-loading the evaluation semantics and the literal formats an agent needs to construct a valid input.

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, return values need not be explained, and the annotations cover the safety profile; the description supplies the operator-precedence and literal-format context that the schema cannot. The one gap is that the dual input mode (expression vs a/b/op) is left entirely to the schema.

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 every parameter carries its own description and example, so the baseline is 3. The description adds no parameter-level meaning: it never clarifies that op/a/b are an alternative to expression, nor what 'bits' masking does beyond what the schema already says.

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 names a specific verb (evaluate) and a well-scoped resource (integer expressions with C-like precedence, hex/octal/binary literals, bitwise ops), which cleanly separates it from calculate_cidr, calculate_percentage and calculate_emi. It never names a sibling explicitly, so the differentiation is by domain rather than by direct contrast.

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 only implied: 'evaluate integer expressions' and 'report base conversions plus signed/unsigned interpretations' tells the agent what it gets, but not when to pick this over e.g. convert_units or calculate_percentage. No exclusions, prerequisites, or note that the tool supports two alternative input modes (expression vs a/b/op).

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.