Nodes/ComfyUI Griptape Nodes/Griptape Tool: Query
ComfyUI Node

Griptape Tool: Query

Let your agent interrogate its own tools — the Query tool, briefly

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape Tool: Query
  • prompt_driver
  • TOOL

The Griptape Tool: Query node adds a skill to your agent: the ability to ask questions about the output of its other tools. In Griptape's tool architecture, tools like the Calculator, WebScraper, or FileManager produce structured output - and sometimes the answer your agent needs is buried in what one of those tools returned. The Query tool gives the agent a way to pull that out, on demand.

This is one of those nodes that sounds abstract until you've hit the problem it solves. Say your agent ran a WebScraper over a long page, then needs a specific fact from what it scraped. Without a query tool, it either re-scrapes (expensive, slow) or hallucinates the detail from fuzzy memory. With it, the agent can query the earlier tool's output directly - like running a focused search over its own workspace instead of starting over.

How it works

The node wraps Griptape's QueryTool and outputs a TOOL (a one-element TOOL_LIST), which you wire into an agent's tool collection - Griptape Create: Agent accepts tool lists, and Griptape Replace: Tools on Agent swaps them in on an existing agent. The only input is an optional prompt_driver; when you provide one, the query tool uses that driver to power its analysis of other tools' output.

There's a neat piece of defensive engineering in the source: if the prompt driver you pass in is a GooglePromptDriver, the node swaps in a patched GeminiQueryTool instead, because the stock QueryTool's prompting doesn't play well with Gemini. So if you run a Google/Gemini-backed agent, the node quietly handles the incompatibility for you. With any other driver, you get the standard QueryTool.

Inputs and outputs

  • prompt_driver - optional PROMPT_DRIVER. Wire in the driver your agent already uses; the query tool leans on it to interpret tool output. Leave empty and it falls back to defaults.
  • TOOL - the output, a TOOL_LIST ready to feed your agent's tools slot.

That's it. It's a thin node - most of the smarts live inside Griptape's framework - so the setup cost is one wire and the real work is making sure the agent is actually using the tools you gave it.

Install

Same pack, same drill - ComfyUI Manager (search "Griptape") or:

cd ComfyUI/custom_nodes
git clone https://github.com/griptape-ai/ComfyUI-Griptape

The pack installs griptape[all] and python-dotenv. The usual Nvidia caveat applies: griptape[all] brings its own torch, and if ComfyUI starts throwing torch errors, reinstall it from the cu121 index per the README.

Common gotchas

The Query tool only helps if it's given to the agent - people wire up a WebScraper and a Calculator and forget the Query node entirely, then wonder why the agent can't follow up on its own results. And remember it's a tool, not a task: it doesn't run on its own, it gets called by the agent when the agent decides to use it. If your agent never invokes it, check whether your prompt driver is one that the node handles cleanly - that Google/Gemini swap exists because a mismatched driver can make the tool behave badly.

CategoryGriptape/Agent Tools

Inputs (1)

NameTypeDefaultDescription
prompt_driveroptPROMPT_DRIVER

Outputs (1)

NameTypeDescription
TOOLTOOL_LIST