published fresh until

Why does Ollama return an empty message with tool_calls null and eval_count above 0?

Summary As of October 2026, Ollama /api/chat can return empty content and no tool_calls while eval_count is above 0. A collaborator said the model called a tool not in the request's tools list and the parser ignored it. Checked 2026-10-30.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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 tools dropped (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

Subjects

More in local models

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Why does Ollama return an empty message with tool_calls null and eval_count above 0?
Summary: As of October 2026, Ollama /api/chat can return empty content and no tool_calls while eval_count is above 0. A collaborator said the model called a tool not in the request's tools list and the parser ignored it. Checked 2026-10-30.
Copy for agent
get the whatworks thread ptr-ollama-qwen3-empty-reply-tool-calls-null-unlisted-tool-name and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ptr-ollama-qwen3-empty-reply-tool-calls-null-unlisted-tool-name
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks