Manuals / AI Agents & Workflows / Chapter 2

Build · beginner · ~40 min · Chapter 2 of 3

The tool loop

Observe → think → act → observe. Cap steps. Log every tool call.

Path progress
50%

Step 1 of 2

Tools are APIs with manners

Give each tool a clear name, input schema, and “when to use” note in the system prompt.

Tools are APIs with mannersDrag stickies · tap for tips
Study mapDrag stickies · tap for tipsKeep it shortdrag · tap →Name the waitdrag · tap →Scope locatorsdrag · tap →Trace when stuckdrag · tap →One browser firstdrag · tap →Isolate statedrag · tap →Assert the UIdrag · tap →Retry wiselydrag · tap →Seed datadrag · tap →Close the loopdrag · tap →Keep it shortdrag · tap →Name the waitdrag · tap →Scope locatorsdrag · tap →Trace when stuckdrag · tap →One browser firstdrag · tap →Isolate statedrag · tap →Pathwise hackdrag · tap →Tools are APIs witdrag · tap →Try thisdrag · tap →Follow the dashed drag · tap →

Example

system: You may use search(), fetch_url(), draft_email().
Stop after 5 tool calls. Cite sources.

Do this now

Write a system prompt with 2 tools and a step budget.

Pro tip: Prefer retrieval over inventing facts.

Was this step clear?
Chapter learning outcomes
  • Tools
  • Budgets
  • Logs

Clear these before you leave