eval_expression
Evaluate arithmetic and boolean expressions inside an AST sandbox to prevent calculation errors, while blocking arbitrary code execution.
Instructions
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
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes | A valid mathematical, arithmetic, or boolean expression string (e.g. '((150 * 12) / 4) + 18.5'). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | ||
| success | Yes | ||
| expression | Yes |