ollama - 💡(How to fix) Fix Cannot use any tool with qwen3 latest [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#14977Fetched 2026-04-08 01:03:39
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
commented ×2closed ×1labeled ×1mentioned ×1

Error Message

Error: The write tool was called with invalid arguments: [

RAW_BUFFERClick to expand / collapse

What is the issue?

write new file with the tool write at C:\Users\user\opencode_test.txt with this exact content: "Hello world" ~ Preparing write... Error: The write tool was called with invalid arguments: [ { "expected": "string", "code": "invalid_type", "path": [ "filePath" ], "message": "Invalid input: expected string, received undefined" } ]. Please rewrite the input so it satisfies the expected schema. How one can do this to work Tested ollama 0.18.2 and ollama 0.17.5

Relevant log output

OS

No response

GPU

No response

CPU

No response

Ollama version

No response

extent analysis

Fix Plan

The fix is to provide a valid string for the filePath argument.

  • Check the input parameters for the write tool to ensure they match the expected schema.
  • Verify that the filePath is a string and not undefined.
  • Update the code to pass the correct filePath string.

Example code:

const filePath = 'C:\\\\Users\\\\user\\\\opencode_test.txt';
const fileContent = 'Hello world';

// Assuming the write tool is a function called 'writeTool'
writeTool({
  filePath: filePath,
  content: fileContent
});

Alternatively, you can also use a library like path to handle file paths:

const path = require('path');
const filePath = path.join('C:', 'Users', 'user', 'opencode_test.txt');
const fileContent = 'Hello world';

writeTool({
  filePath: filePath,
  content: fileContent
});

Verification

To verify the fix, run the write

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

ollama - 💡(How to fix) Fix Cannot use any tool with qwen3 latest [2 comments, 2 participants]