Skip to content

Tool calling not executed with Ollama models (outputs raw tool JSON instead of performing actions) #433

Description

@nascimentoraphael

Steps to Reproduce
Install and run Ollama locally

Pull a model that supports tool calling:

ollama pull qwen2.5-coder:14b

Configure OpenClaude to use Ollama:

export CLAUDE_CODE_USE_OPENAI=1
export OPENAI_BASE_URL=http://localhost:11434/v1
export OPENAI_MODEL=qwen2.5-coder:14b

Start OpenClaude:

bun run dev

Run a prompt that requires tool usage:

Summarize this repository structure.
Expected Behavior

OpenClaude should:

Detect the repository context
Invoke the appropriate internal tool (e.g., file system or repository inspection)
Return a structured summary of the local project
Actual Behavior

Instead of executing the tool, the model returns a raw tool call:

{
"name": "WebSearch",
"arguments": {
"query": "repository structure"
}
}

or previously:

{
"name": "repository_structure",
"arguments": {...}
}

or even natural language describing how to call the tool:

"The correct request would look like this..."

No actual tool execution occurs.

Environment
OpenClaude version: v0.1.8
OS: Linux (Ubuntu-based)
Terminal: Bash
Provider: Ollama (OpenAI-compatible endpoint)
Model: qwen2.5-coder:14b (also tested with llama3.1:8b and gemma3:latest)
Logs / Screenshots

Example output:

❯ Summarize this repository structure.

● {
"name": "WebSearch",
"arguments": {
"query": "repository structure"
}
}

For gemma3:

API Error: 400 ... "does not support tools"
Additional Context
The provider connection is successful:
/v1/models endpoint reachable (status 200)
OpenClaude shows "Ready"
Multiple models tested:
gemma3:latest → explicit error (no tool support)
llama3.1:8b → describes tool usage instead of executing
qwen2.5-coder:14b → outputs raw JSON tool calls
This suggests a potential issue in:
tool execution loop
or OpenAI-compatible tool mapping layer for Ollama

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions