The manual way
Under the hood, tool calling is a multi-turn conversation:- You describe available tools as JSON schemas
- The model returns a tool call instead of text
- You execute the function and send the result back
- The model responds with text (or more tool calls)
Automating schema generation
Both SDKs include utilities that derive JSON schemas from your function signatures, eliminating hand-written JSON:DedalusRunner: tools without the plumbing
DedalusRunner handles everything above automatically. Pass raw functions — it extracts schemas, dispatches tool calls, manages the conversation loop, and keeps calling the model until the task is done.
Best practices
- Type your parameters and returns — the SDK uses them to generate accurate schemas. In Python, Pydantic extracts rich types. In TypeScript, parameter names are extracted at runtime (types are erased), so use Zod for richer schemas.
- Write docstrings — the model reads them to decide when and how to call the tool.
- Use clear names —
get_weathertells the model more thando_thing. - Keep the count low — models perform better with fewer than 20 tools. Combine functions that are always called in sequence.
Async tools
Tools can be async. The Runner awaits them automatically:Model selection
Next steps
Runner Reference
Full DedalusRunner.run() parameter reference
MCP Servers
Hosted tools for external capabilities
Structured Outputs
Validate and parse JSON into schemas
Use Cases
End-to-end agent patterns