Tools
Noduma passes tools and tool_choice to the engine of the PC that answers, llama.cpp's server, and relays the calls the model makes. Your program runs the tool and sends its result back. Whether a model calls tools well depends on the model; Qwen3 Coder 30B-A3B and gpt-oss 20B were chosen for the catalog with tool calls in mind.
The exchange
Section titled “The exchange”- Send
tools, an array of function tools in OpenAI's form ({"type": "function", "function": {"name", "description", "parameters"}}). Anything else intoolsthan an array is refused with400 invalid_request. - The answer has
finish_reason: "tool_calls"andmessage.tool_calls, each with anid,type: "function"andfunction.nameandfunction.arguments(a JSON string).contentisnullwhen the answer is only calls. - Run each tool. Send the whole conversation again: the
assistantmessage with itstool_calls, then onetoolmessage per call, with itstool_call_idand the result ascontent.
{ "model": "qwen3-coder-30b-a3b-instruct-q4_k_m", "tools": [{"type": "function", "function": {"name": "get_weather", "parameters": {"type": "object", "properties": {"city": {"type": "string"}}}}}], "messages": [ {"role": "user", "content": "What is the weather in Madrid?"}, {"role": "assistant", "content": null, "tool_calls": [ {"id": "call_1", "type": "function", "function": {"name": "get_weather", "arguments": "{\"city\": \"Madrid\"}"}} ]}, {"role": "tool", "tool_call_id": "call_1", "content": "{\"temperature_c\": 14, \"sky\": \"clear\"}"} ]}When streaming, the calls arrive in one chunk with delta.tool_calls near the end. See Streaming.
Billing
Section titled “Billing”Tool definitions, calls and results are part of the request and the answer: their bytes are measured and charged like text. See Credits.
Safety
Section titled “Safety”A tool call is text the model wrote on someone's PC. Check its arguments before you act on them, as you would any input from outside your program. noduma agent asks before it writes a file or runs a command for this reason; see chat and agent.