The manual way
Under the hood, tool calling is a three-step process.- Describe the structure of the tool as a JSON schema and pass it to the model
- The model fills in the JSON schema and outputs it for the application to parse
- The application executes the tool call and send the results to the model
1. Describe the tool schema
TypeScript
2. Give tool call schema to model
TypeScript
3. Execute the tool call
TypeScript
TypeScript
The Dedalus Way
TheDedalusRunner supports automatic tool calling serialization.
This means that it handles schema extraction, tool dispatch, conversation looping, and final response handling. All you have to do is pass in your function into the tools parameter!
TypeScript
See Response Schemas for the full
ChatCompletion and RunResult
shapes, including tool_calls fields.Writing good tools
Type your functions. Annotations become the JSON schema the model sees.city: string becomes {"type": "string"}. The more specific the types, the better the model fills them in.
Write docstrings. The Runner uses your docstring as the tool’s description. The model reads it to decide when to call the function.
Use descriptive names. The model picks which tool to call by name. getWeather beats doStuff.
Keep tool counts low. Tool schemas take up space in the context window. Minimize the tools you pass for a given task.
Read more
Dedalus Runner
Learn more about the DedalusRunner
MCP Servers
Learn how to connect MCP servers to your Dedalus models
Structured Outputs
Guarantee that your model outputs the desired schema every time
Use Cases
End-to-end examples for inspiration