Example: Adding a Calculator to Our Agent › Glossary

Michael BrenndoerferJune 29, 20251 min read
AI Agent HandbookAll chapters
Part 5 of 15Tool Use - Extending the Agent's Abilities
Chapter 14Example: Adding a Calculator to Our Agent › Glossary
Reading section 15 of 16 · Glossary · 1 minSection 15 of 16 · 1 min

Book contents

Section 15 of 16 · 1 min read

Example: Adding a Calculator to Our Agent › GlossaryOne section · Sections in this chapter15 / 16 ↓

Tool Registry: A dictionary or mapping that connects tool names to their actual Python function implementations, allowing the agent to look up and call tools dynamically.

Tool Use Block: The structured response from the language model indicating it wants to use a tool, including the tool name and the parameters to pass to it.

Stop Reason: A field in the model's response indicating why it stopped generating. A value of "tool_use" means the model wants to call a tool.

Tool Result: The output returned by a tool function after it executes, which is sent back to the agent so it can incorporate the information into its response.

Parameter Extraction: The process by which the agent identifies the necessary values from a user's question and formats them as inputs for a tool function.

Error Handling: The practice of catching and gracefully managing errors in tool execution, returning structured error information that the agent can communicate to the user.