Skip to main content
A tool is a function you expose to a language model. Concretely, it specifies the input and output schema that describes what the function takes in and what it outputs. Tool calling is useful because language models cannot execute code by itself. It can only specify which function should be invoked and how.

The manual way

Under the hood, tool calling is a three-step process.
  1. Describe the structure of the tool as a JSON schema and pass it to the model
  2. The model fills in the JSON schema and outputs it for the application to parse
  3. 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
When put all together, a simple tool call looks like this:
TypeScript
That’s a lot of work! You are hand-writing schemas, parsing args, dispatching tool calls, and maintaining the request/response loop yourself.

The Dedalus Way

The DedalusRunner 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
Last modified on June 30, 2026