Skip to main content
Back to Components manual

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

  1. Add Calculator, enable Tool Mode, and connect the tool output to Agent Core.
  2. Ask the Agent to calculate a test expression and confirm the result.

Normal mode

  1. Enter an expression or connect Text Input to Expression.
  2. Read the result field from the Data output.

Configuration

SettingWhat it controlsRecommended starting point
ExpressionDefines the numeric expression to evaluate.Try (100 + 50) * 0.15.
Tool ModeReplaces 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.

Back to Components manual