Nodes/ComfyUI Griptape Nodes/Griptape Convert: Agent to Tool
ComfyUI Node

Griptape Convert: Agent to Tool

Making One Agent Another Agent's Tool

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape Convert: Agent to Tool
  • agent
  • TOOL
off_promptfalse
nameGive the agent a name
descriptionDescribe what the agent should be used for

This is the node that lets you build agents of agents. Griptape Convert: Agent to Tool takes a fully-built agent - rules, tools, personality, the works - and wraps it up so another agent can call it like a tool. It's the pack's answer to hierarchical agents: you build a specialist, then hand that specialist to a manager agent as if it were a calculator. The official YouTube demo for this exact node is titled "Convert an Agent to a Tool... and give it to another Agent."

What it's for

Say you've built a research agent with a WebScraper tool and a writing agent with strict style rules. Rather than cramming all of that into one agent, you convert each into a tool and give both to a coordinator agent that decides which specialist to invoke. Each sub-agent keeps its own memory, rules, and tools - the manager just sees "here's a thing I can call."

This is also one of the more community-loved ideas in the LLM-in-ComfyUI space, which is exactly the demand this pack answers: people wanted to build real agent pipelines on the node graph instead of living in a single chat form. This node is the piece that makes delegation graph-native.

How it works

Under the hood it creates a StructureRunTool with a local driver that instantiates your agent on demand:

driver = LocalStructureRunDriver(create_structure=lambda: agent)
tool = StructureRunTool(name=to_pascal_case(name),
                        description=description,
                        structure_run_driver=driver,
                        off_prompt=off_prompt)

The name you type gets converted to PascalCase automatically (my_researcherMyResearcher), which is the name the parent agent sees and can invoke. The description is what tells the parent agent when to call this tool - write it like you'd write a function docstring, because the LLM reads it to decide.

Inputs and output

  • agent (AGENT) - the agent to convert. Required; nothing happens without it.
  • name (STRING) - the tool's name, auto-PascalCased. Make it descriptive but short.
  • description (STRING, multiline) - when and why to use this tool. This is the most important input for real behavior.
  • off_prompt (BOOLEAN, required, default false) - if true, the sub-agent's output is kept private and not fed back to the parent's context (saves tokens; useful when the sub-agent's internals are noisy).
  • Output: TOOL (TOOL_LIST) - feed this into a Combine Tool List or straight to an agent's tools input.

Installation

Part of ComfyUI Griptape Nodes:

  • ComfyUI Manager: search "Griptape" → install.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/griptape-ai/ComfyUI-Griptape, restart ComfyUI.

Gotchas

  • Nested agents are slow and token-hungry. Each sub-agent call is a full agent run, so a chain of three nested calls can burn real money on paid APIs. Start with one level of nesting.
  • A bad description means the parent never calls the tool, or calls it at the wrong time. Get the "use this when..." phrasing right.
  • With no agent connected the node returns nothing - silent, no error. Wire the agent in before you go hunting for bugs elsewhere.

For anyone who's ever wished they could hand a task to a specialist and move on, this node is how that wish becomes a graph.

CategoryGriptape/Agent Tools

Inputs (4)

NameTypeDefaultDescription
off_promptBOOLEANfalse
agentoptAGENT
nameoptSTRINGGive the agent a name
descriptionoptSTRINGDescribe what the agent should be used for

Outputs (1)

NameTypeDescription
TOOLTOOL_LIST