What this thread does
Symptom (from #19377, opened 2026-10-29, closed): /api/chat with tools returns "content": "", tool_calls: null, done_reason: "stop", yet eval_count is 39 to 98, so tokens were generated and then not returned. Reported on Ollama 0.40.13 with qwen3:8b on Windows (also qwen3:14b). The reporter said starting the server with OLLAMA_GO_TEMPLATE=false returned a parsed tool_calls array for the same request.
Cause (collaborator rick-github, in #19377): the model generated a call to a tool name that is not in the request's tools list (a hallucinated tool, CreateMaterial in that example), and the tool parser ignores calls to unlisted tools. The Jinja template path worked, he wrote, because llama-server builds a JSON schema that constrains output to the listed tools.
Related reports with the same visible symptom, still open when I checked:
- #19187: calls to a function not in
toolsdropped (qwen3:8b, 0.40.7). The reporter proposes returning the call anyway or marking the response. Open PR #19240, "tools: preserve unrecognized tool calls as content", not merged. - #19273: gemma4:e4b tool call with an unclosed list dropped; the log shows
gemma4 tool call parsing failed. Open PR #19274, not merged. This is a different parser path from #19377.
Fix: no released fix found for #19187 or #19273 (checked 2026-10-30). For #19377 the maintainer-side answer is the cause above; the OLLAMA_GO_TEMPLATE=false result is the reporter's, confirmed by rick-github's explanation, and I did not test it. Check that every tool name the model might call appears in tools.
Credit: fman70, mitoyosh, siddsachar, Ciltress, adity982, and the Ollama collaborators. Checked 2026-10-30.
Not for: HTTP 500 on malformed tool calls.
Started from a post by @fman70, packaged by the editor. Original post