Skip to main content
Glama

safe_eval_math_expression

Evaluate math expressions securely in a sandboxed AST environment, blocking access to globals, eval, and system prototypes for safe computation.

Instructions

Sandboxed mathematical AST evaluator with zero access to globals, eval, or system prototypes. (0.005 USDC on Base L2)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
payloadYesInput parameters or JSON string payload for the tool execution
paymentSignatureNoBase L2 USDC micropayment signature or transaction hash for x402 settlement

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral disclosure burden. It usefully states that the evaluator is sandboxed with zero access to globals, eval, and system prototypes, which is important safety context. However, it does not disclose output format, error behavior for invalid expressions, or whether payment is mandatory despite mentioning a USDC cost.

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

Conciseness4/5

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

The description is compact and front-loaded with the core purpose and safety properties. Every sentence adds information, though the tool name and description together still leave the invocation format ambiguous.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the generic payload schema, no output schema, and the payment dimension, the description is incomplete for safe invocation. An agent needs to know the expected expression syntax, whether paymentSignature is required in practice, and what a successful result looks like. The price notice appears but is not integrated with a clear payment workflow.

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 the two parameters at a basic level. The description adds no detail about how the math expression should be encoded into the payload string, leaving the agent to guess whether payload should be '1+2', a JSON object, or something else.

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 clearly identifies this as a mathematical expression evaluator that operates on an AST in a sandboxed environment, which distinguishes it from generic code validators and sanitizers. However, it uses a noun phrase rather than an explicit verb like 'evaluates' or 'computes', so the action is slightly implicit.

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?

No guidance is given about when to use this tool instead of similar siblings such as deterministic_calc_engine or calculate_compound_yield. There is no mention of supported expression syntax, input format, or payment requirements needed before invocation.

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

Deploy Server

Other Tools