Function tools and hosted tools
Function tools and hosted tools
In lesson 09.02 you built a tool by writing a Pydantic model, extracting its JSON Schema, wrapping it in a dict, and writing a dispatcher to route calls by name. The Agents SDK collapses all of that into one decorator on an ordinary function. The type hints become the schema, the docstring becomes the description, and the runner does the dispatching and the validation. What you learned about naming, descriptions, and short results applies unchanged; only the boilerplate is gone.
There is a second kind of tool that runs on OpenAI's side rather than yours: hosted tools such as web search, file search, and a code interpreter. And there is a third pattern, an agent used as a tool by another agent, which is the small-scale version of the multi-agent systems in lesson 10.03.
Continue reading
Pro unlocks every video lesson, the full notes and runnable code across the Python with AI course, from the language itself to agents, MCP, Langfuse and deployment.