Skip to main content
Glama

eval_expression

Deterministically evaluates arithmetic, mathematical, and logical expressions inside an AST-isolated sandbox. Prevents LLM calculation errors while strictly blocking arbitrary code execution. Use for reliable numerical calculations and boolean logic. Do not use for executing arbitrary Python statements or importing external libraries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYesA valid mathematical, arithmetic, or boolean expression string (e.g. '((150 * 12) / 4) + 18.5').

TDQS

A4.6/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full disclosure burden. It discloses the critical safety traits: deterministic evaluation, AST isolation, and strict blocking of arbitrary code execution. It stops short of stating error behavior for invalid expressions, return format, or numeric precision, which would make it fully transparent.

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 sentences with zero filler. The core purpose is front-loaded, followed immediately by the use/don't-use guidance. Every clause earns its place.

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 single-parameter tool with full schema coverage and no output schema, the description covers purpose, safety behavior, and usage exclusions concisely. The only genuine gaps are return format and error handling for malformed expressions, which are not disclosed anywhere.

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

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the schema already documents the expression parameter with an example. The description adds value by constraining what counts as a valid expression (arithmetic/mathematical/boolean only) and explicitly excluding arbitrary Python statements, which sharpens the parameter's intended scope 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?

States a specific verb ('evaluates') and a well-defined resource ('arithmetic, mathematical, and logical expressions'), plus the AST-isolated sandbox context. The stated purpose of preventing LLM calculation errors and blocking arbitrary code execution makes it unmistakably distinct from the unrelated siblings (audit_dns, chunk_text, extract_web, repair_json, validate_schema).

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

Usage Guidelines5/5

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

Explicitly directs when to use ('reliable numerical calculations and boolean logic') and, in the next sentence, when not to ('Do not use for executing arbitrary Python statements or importing external libraries'). This is a clear inclusion/exclusion pair with no ambiguity left to inference.

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.

TDQS

A4.4/5.0
Disambiguation5/5

Each tool serves a clearly distinct purpose: DNS verification, text chunking, expression evaluation, web extraction, JSON repair, and schema validation. There is no overlapping functionality, and the descriptions explicitly state boundaries (e.g., 'Do not use for' clauses) that prevent misselection.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (audit_dns, chunk_text, eval_expression, extract_web, repair_json, validate_schema). The verbs are descriptive and uniform, making the naming predictable and scannable.

Tool Count5/5

With 6 tools, the server is well-scoped for a utility server. Each tool addresses a common agent need without redundancy, and the count falls in the ideal range for easy comprehension and selection.

Completeness4/5

The tool set covers common utility gaps (DNS safety, text preparation, calculation, web content, JSON handling). Minor omissions exist, such as a dedicated string manipulation or encoding tool, but the core utilities are complete enough for most agent workflows without dead ends.

Resources