eval_expression
Evaluate arithmetic and logical expressions in a secure AST sandbox to prevent calculation errors and block 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'). |