Tool Calculator

A math calculator tool for AI agents. Evaluates mathematical expressions — whitelisted functions only.

Written By pvdyck

Last updated About 3 hours ago

Tool Calculator

The Tool Calculator gives AI agents the ability to evaluate mathematical expressions accurately, instead of relying on the LLM's (often unreliable) built-in math capabilities.

How It Works

When connected to an Agent node, the calculator appears as a tool the agent can invoke. During reasoning, if the agent encounters a math problem, it calls the calculator with an expression and receives the exact result.

Parameters

This node has no configurable parameters. It automatically registers as a tool named "calculator" with the connected agent.

Supported Operations

CategoryAvailable
Operators+, -, *, /, ^ (power), % (modulo), parentheses
Math functionsMath.abs, Math.ceil, Math.floor, Math.round, Math.sqrt, Math.pow, Math.sin, Math.cos, Math.tan, Math.log, Math.exp, Math.min, Math.max
ConstantsMath.PI, Math.E

Connects To

Parent NodeDescription
AgentProvides the agent with a calculator tool for math operations.

Limitations

  • Math expressions only — Cannot execute arbitrary code or access workflow data.
  • Whitelisted functions only — Only the Math functions listed above are available. No custom functions.
  • Cannot be used standalone — must be connected to an Agent node.

Tips

  • Always connect the Calculator when your agent may need to do math — LLMs frequently make arithmetic errors without it.
  • The agent decides when to use the calculator based on its reasoning. You can encourage use via the agent's system prompt.
  • For custom logic beyond math, use the Code Tool instead.

Related