Agents become useful when they can do things beyond generating text. Tools let them call functions, query databases, make API requests—anything you can express in code.
How It Works
Define a function with type hints and a docstring. Pass it to runner.run(). The Dedalus SDK extracts the schema automatically and handles execution when the model decides to use it.
The model sees the tool schemas, decides which to call, and the Runner executes them. Multi-step reasoning happens automatically—the Runner keeps calling the model until it can complete the task.
Good tools typically have:
- Type hints on all parameters and return values
- Docstrings that explain what the tool does (the model reads these)
- Clear names that indicate purpose
Tools can be async. The Runner awaits them automatically:
Wrap a specialized agent as a tool. The coordinator delegates specific tasks to specialists without giving up conversation control.
This differs from handoffs:
- Handoffs: New agent takes over the conversation with full history
- Agent as tool: Specialist receives specific input, returns output, coordinator continues
When to use this pattern:
Model Selection
Tool calling quality varies by model. For reliable multi-step tool use:
openai/gpt-5.2 and openai/gpt-4.1 handle complex tool chains well. Older or smaller models may
struggle with multi-step reasoning.
Next steps
- Route across models: Handoffs — Route to different models mid-conversation
- Return typed data: Structured Outputs — Validate and parse JSON into schemas
- Stream progress: Streaming — Show tool-call progress in real time
- See full examples: Use Cases — End-to-end agent patterns