← All tools
EDTOOLKITS GUIDES

A Simple Agent: Follow the Loop and Its Step Limit

By Team Edtoolkits · AI learning

Inspect scripted tool exchanges and compare successful completion with a messy run stopped by a cap.

Use the guide alongside the working tool.

Open Build a Tiny Agent with Tools →

Explore the lesson

Write two safe tools: a calculator that cannot run code and a read-only notes search.

Write the loop that asks the model, runs the chosen tool and feeds back the result.

Run it on a question that needs both tools and read the trace.

A comparison to try

Replay the clean and messy scenarios, following each requested action and returned observation. Compare a cap that stops early with one that permits the scripted completion, and inspect malformed or unknown-tool responses.

Read the result

The application parses a request, checks the available tool and feeds back the result before another model step. A step cap bounds this loop; a stopped run still needs a clear incomplete outcome rather than an invented success.

A mistake to avoid

The page is a written tutorial with a fixed replay, not a live autonomous agent. Step limits alone do not control permissions, data exposure or harmful actions. A real implementation needs explicit tool validation and a restricted execution environment.

Teaching model and privacy

A written tutorial: nothing here runs a model in your browser. The loop stepper replays a scripted example to show the logic, not a live model. Small local models can follow the reply format poorly, so results vary. Commands change as tools update, so check each project's official documentation if one fails.

Ready to apply this workflow?

Try Build a Tiny Agent with Tools →

Explore a related workflow

All practical guides →

Found unclear instructions or an unexpected result? Contact Team Edtoolkits.

YOUR BROWSER, YOUR CHOICE