Tool-calling agent
In Boltjar a tool is a small branch of nodes. The model sees a name and a description; when it calls the tool, the branch runs with the model’s arguments, and whatever reaches the end of the branch goes back to the model. This graph gives a local model two tools: the time on your computer, and the weather in a city.
Download the graph and save it in user/graphs/, or build it below. The graph is MIT-0: copy it and license what you build from it however you like.
1. The chat
Section titled “1. The chat”The same chat as in Chat with Ollama: a Chat Input named Message, a Prompt, an LLM and a Chat node, wired the same way. The downloaded graph has no model picked: pick one that takes tools on the LLM, such as Qwen3 14B (Ollama). Its tool sockets, and the wires from the two Tool nodes into them, show once that model is picked. Use this Prompt:
You are a helpful assistant. Use your tools when they help.
User: {message}2. A tool without arguments: get_time
Section titled “2. A tool without arguments: get_time”| Node | Settings |
|---|---|
| Tool, named get_time | name get_time, description Returns the current date and time on this computer. |
| Tool Args, named get_time args | fields empty |
| Time, named Now | format Monday 08 Jun, 02:30 PM |
| Template, named Time answer | It is {now}. |
| From | To |
|---|---|
get_time call |
LLM + tool (it becomes tool0) |
get_time call |
get_time args call |
get_time args trigger |
Time answer trigger |
Now out |
Time answer now |
Time answer out |
get_time result |
Right-clicking a Tool offers to add its Tool Args already wired. Wiring the Template’s trigger makes it assemble when the tool is called and send the text on, and that text landing on result is the tool’s answer. The {now} tag is named after the Now node, the way a dropped wire names a tag.
3. A tool with an argument: get_weather
Section titled “3. A tool with an argument: get_weather”| Node | Settings |
|---|---|
| Tool, named get_weather | name get_weather, description Returns the current weather for a city, in one line. |
| Tool Args, named City | fields city |
| HTTP Request, named Weather API | method GET, url https://wttr.in/{city}?format=3, response text |
| From | To |
|---|---|
get_weather call |
LLM + tool (it becomes tool1) |
get_weather call |
City call |
City trigger |
Weather API trigger |
City city |
Weather API + tag (it becomes city) |
Weather API body |
get_weather result |
Typing city in the Tool Args fields does two things: the node grows a city output, and the tool tells the model it takes a city argument. The Tool’s schema mode stays auto for that. A wire dropped on the HTTP Request’s + tag makes a tag named after the node it comes from, which is why this Tool Args is named City: its wire becomes the {city} in the url.
4. Ask
Section titled “4. Ask”Press On and ask “What time is it?” or “How is the weather in Lisbon?”. The model decides whether to call a tool; each call runs its branch, and the Tool node shows the arguments and the result. A reply can take up to six rounds of tool calls before the model has to answer.
How it works
Section titled “How it works”- The model only sees the Tool’s
nameanddescription, and the parameters. Write the description for the model: say what the tool returns and when to use it. - Tool calls work with Ollama, xAI, Anthropic, OpenAI and OpenAI-compatible models that take tools, as their manifest or their provider says. The LLM page lists the ones that ship with a manifest.
- Two tools cannot share a name, and a tool needs one: the graph will not turn On otherwise.
- If a branch never sends a result, the model gets an error for that call after two minutes.
- A tool branch is a graph like any other: DB lookups, Read File, HTTP Request with a
{{secret.NAME}}key. Keep in mind that the model chooses the arguments, so treat them as untrusted input (Security).