Calculator
On this page
Purpose
Calculator evaluates a numeric expression and returns the result as Data. It supports addition, subtraction, multiplication, division, exponentiation, and parentheses.
When to use it
- Evaluate a fixed formula in a flow.
- Calculate a value from Text Input.
- Give Agent Core a narrow arithmetic tool.
How to use it
Tool Mode
- Add Calculator, enable Tool Mode, and connect the tool output to Agent Core.
- Ask the Agent to calculate a test expression and confirm the result.
Normal mode
- Enter an expression or connect Text Input to Expression.
- Read the
resultfield from the Data output.
Configuration
| Setting | What it controls | Recommended starting point |
|---|---|---|
| Expression | Defines the numeric expression to evaluate. | Try (100 + 50) * 0.15. |
| Tool Mode | Replaces the Data output with a Toolset handle offering an evaluate_expression tool. | Leave it off for a fixed flow step. |
Expected result
A successful run returns Data such as {"result": "4"}, with the result as text. Invalid expressions and division by zero return data with an error field and the expression you sent, rather than stopping the flow. Results use floating-point arithmetic and are formatted to six decimal places when needed.
Calculator reads whole numbers and decimals joined by those operators. It does not accept a leading minus, so write 0-5 rather than -5, and it does not accept other symbols such as %.
Reference details
Connect the normal Data output to Parser or Data Operations. In Tool Mode, connect the tool output to Agent Core's tools input.
