liveBook · Manning

Tool chaining

As explained in Software Testing with Generative AI

Tool chaining is a technique in which an agent passes the result of one tool invocation as input to a subsequent tool invocation.

Tool chaining lets an agent pass the result of one tool invocation into a later invocation, enabling multi-step tasks instead of independent actions. section 9.2.2 section 9.2.3

A typical implementation retrieves a value from a database, returns it to the agent’s context, and exposes it as a parameter for the next tool. Tool descriptions can suggest ordering, but they do not guarantee execution order. section 9.2.3

Linking rooms to bookings

After creating three rooms, the agent calls a tool that retrieves the most recent roomid. It then supplies that roomid to a booking tool, which inserts three bookings linked to the selected room. section 9.2.3

How Software Testing with Generative AI covers it

How deep it goes
Explains value retrieval, context passing, annotated parameters, and ordering guardrails, but does not guarantee model-selected execution order.
Examples
Demonstrates room creation, latest-room lookup, room-linked booking insertion, and database listing.
What it assumes
Assumes familiarity with agents, tools, database queries, and method parameters while demonstrating the value flow concretely.
What you can do after
Apply it via annotated tool methods that return values and accept those values as parameters in later operations.
How it connects
Connects AI agents with tools, prompts, databases, SQL operations, and execution context.

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 Software Testing with Generative AI. The section links point to the parts of the book it draws on.