Griptape Tool: Calculator
LLMs can't do math. This tool is the fix.
- TOOL
Every LLM - even the expensive ones - will confidently tell you that 2,784 × 933 is something it very much is not. The Calculator tool exists for exactly that reason. It's one of the smallest nodes in the Griptape pack: it wraps Griptape's CalculatorTool and hands it to your agent so that when the agent needs actual arithmetic, it calls the tool instead of hallucinating an answer.
The mental model to keep in mind with any Griptape tool node: the tool doesn't do anything until an agent decides to use it. You're not calculating anything by placing this node - you're giving the agent a capability. The agent sees the tool in its toolkit, recognizes "this task involves math," and invokes it. That's the whole Griptape design, and it's why these tool nodes all emit a TOOL_LIST rather than a computed value.
How it works
At creation, the node instantiates a CalculatorTool with the off_prompt flag you set, and returns it as a one-item tool list. Wire that list into your agent's tools input. When the agent calls the tool, Griptape runs the arithmetic as real Python, not as the model guessing - so the answer is actually correct, and the model just relays it. It's the difference between a model estimating and a model looking something up.
The one input that matters
- off_prompt - default
False. This controls whether the calculator's output is shown to the model. Default off means the model does see the result (which is what you want - the whole point is the agent relays a correct answer). The other setting,True (Keep output private), runs the calculation off-prompt so only a processed result you explicitly request reaches the LLM's context. For a calculator you basically always leave this at the default; the privacy toggle matters far more for tools like FileManager or WebScraper where raw output is big or sensitive.
That's the entire surface - there are no other inputs. The single output, TOOL (TOOL_LIST), feeds an agent.
Install
It's part of the ComfyUI-Griptape pack, so install once and you get all the tools:
cd ComfyUI/custom_nodes
git clone https://github.com/griptape-ai/ComfyUI-Griptape
or ComfyUI Manager → search "Griptape" → install, then restart. The pack's requirements (griptape[all], python-dotenv) install automatically.
Where people get burned
The usual beginner trap is expecting a result out of the tool node directly. There isn't one - you need the whole chain: Calculator tool → agent → a Run Agent (or prompt task) that actually asks the agent something with numbers in it. Ask "what's 17% of 2,450 and then add 88?" and watch it delegate to the calculator. Ask nothing, and the tool just sits there.
One more thing worth knowing: Calculator is free and local - no API key, no network call. That makes it a nice first tool to wire up when you're learning how the agent-tools flow works in this pack, before you add the key-hungry ones. Pair it with the DateTime tool and your agent suddenly knows both how to think about numbers and what day it is.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| off_prompt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| TOOL | TOOL_LIST | — |