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
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes | A valid mathematical, arithmetic, or boolean expression string (e.g. '((150 * 12) / 4) + 18.5'). |