Skip to content

Runnable As Tool

Runnable As Tool turns an agent or a chain in your flow into a tool for another agent. This lets you build a team: a main agent that talks to the user and, connected to it, specialist agents it consults when needed.

You connect the specialist agent or chain to the Runnable input, give it a name and a description, and connect the Tool output to the main agent’s Tools input. The main agent decides when to ask the specialist for help based on the description you give it.

When to use it

  • A general assistant hands legal questions to an agent that specialises in regulations.
  • You want separate agents for sales and technical support, with one agent that routes the questions.
  • An agent that writes reports consults another one that analyses data.
  • You have a chain that already works well and want an agent to use it as one more tool.

Configuration

FieldWhat it does
Runnable (required)The agent or chain that becomes a tool.
Tool NameThe tool’s name, as the main agent will see it. Use a short, clear name, for example legal_expert.
InputThe data the specialist runs with when you use the Result output, written between braces. Defaults to {"query": "Question"}. Hidden when you connect the Tool output.

Advanced options

FieldWhat it does
Tool DescriptionTells the main agent what the specialist is for and when to consult it. The clearer it is, the better the agent chooses.
Tool Arguments SchemaThe data the main agent must send to the specialist, with its name, description and whether it is required. If you leave it empty, the data the specialist expects is used.
Return DirectWhen on, the specialist’s answer is delivered as is, without the main agent rewriting it. Only applies when you fill in Tool Arguments Schema. Off by default.
VerboseDoes not change the result. Leave it off.

Output

  • Tool: connects to the main agent’s Tools input.
  • Result: the specialist’s answer when run with the Input data. Useful to test it before connecting it as a tool.

When you connect one of the two outputs, the other one is hidden.

Example

An accounting firm wants an assistant that answers general questions and hands tax questions to a specialist.

  1. Create an agent with tax expert instructions and connect it to the Runnable input of Runnable As Tool.
  2. In Tool Name write tax_advisor, and in Tool Description: “Ask this advisor any question about taxes, tax returns or filing deadlines”.
  3. Connect the Tool output to the general assistant’s Tools input.
  4. A client asks “When do I have to file this quarter’s VAT return?”. The general assistant consults the tax advisor and answers with what it says.
  • Agent: the main agent that uses the tool.