liveBook · Manning

Tool chaining

As explained in AI Agents in Action, Second Edition

Tool chaining is the process in which the output of one tool call becomes the input to a subsequent tool call.

Tool chaining passes one tool’s output into the next tool’s input, allowing an agent to complete a larger goal through connected tasks. Like a relay race, each call hands useful information to the next step rather than starting independently. section 1.1.2 section 2.4.2

Use this mental model to distinguish dependent chains from independent tool calls:

  • A sequential chain waits for an earlier result: retrieve available research sources, then use each source to obtain its URL. section 2.4.2
  • An agent or prompt may define the chain explicitly, or the agent may decide which tools should follow one another. section 2.4.2
  • Independent calls can run in parallel, reducing latency; parallel execution does not work when one call needs another call’s output. section 2.4.2
  • Trace events expose call order, inputs, outputs, and timing, helping locate incorrect decisions and performance bottlenecks. section 2.4.2

Research planning chain

A research-planning agent first calls get_research_sources(), then passes each returned source to get_resource_url(). It uses those results to produce a research plan restricted to the available sources. Typed structures describe sources and tasks, making the intermediate data inspectable. section 2.4.2

Table 1.2 Example goals, and the tasks and tools needed to carry them out

Goals

Tasks

Tools

Create an image

Create an image

create_image

Travel to Calgary (YYC)

Search for flights

Book flights

Book hotels

Book transportation

search_flights

book_flights

book_hotels

book_transportation

Buy a computer

Search for computers

Compare features and prices

Order a computer

web_search

web_search

order

Compare multi-step goals with their task-level tools, including travel chains that search for flights before booking flights, hotels, and transportation. section 1.1.2

How AI Agents in Action, Second Edition covers it

How deep it goes
Defines dependent and parallel calls, demonstrates a research chain, and covers tracing, but defers advanced non-OpenAI API configuration.
Examples
Uses research-source lookup, travel booking, computer purchasing, and image creation to illustrate chained tasks and tools.
What it assumes
Assumes basic awareness of agents and tools while explaining task decomposition and dependent calls through concrete examples.
What you can do after
Diagnose/debug chains with OpenAI Traces and distinguish dependent sequences from parallel calls when designing agent workflows.
How it connects
Connects agents, tool use, task planning, parallel tool calls, tracing, and typed input/output schemas.

Also explained in

Compare how 3 books explain tool chaining →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents in Action, Second Edition. The section links point to the parts of the book it draws on.