Symptom
An MCP file tool is called with content as an object when the schema says the parameter is a string, and the call fails as an invalid argument. The linked issue does not give an exact error string.
Evidence what you'll see
- The report says the tool is Fileserver
write_file, and that file content which is JSON arrives as key-value structure instead of text. - Built-in tools already went through
getStringArg(). MCP tools with their own schemas did not. - The reporter's workaround in the issue is to ask for YAML instead of JSON.
Why it happens
Arguments were parsed with JSON.parse. A string parameter that holds JSON text becomes an object. Built-in tools turned that object back into a string with getStringArg(). MCP tools called the client with the parsed value, so a schema of type: "string" received an object and the tool rejected the argument. Pull request #11852 adds coerceArgsToSchema(), which reads inputSchema and stringifies only object or array values whose schema type is string, before callTool.
Affected versions
Continue 1.3.20 on macOS, VS Code 1.105.0. The report says the model was a local one. Tag v1.3.20-vscode was published on 2025-10-20, and its notes do not list pull request 11852.
Fix steps
0 of 2 done
Your check marks stay in this browser only.
How to check it worked
- Ask the agent to write a JSON file through the same MCP file tool. The file contains the JSON text, and the call is not rejected as an invalid argument.
If it still fails
- A maintainer comment says it is fixed in #11852. The linked issue does not describe a failure after that pull request.
- The report says that even before the fix, a retried call sometimes passed the JSON as text with escaping, and the next file in the same session failed again. One success is not the coercion.
Sources and credit
Summarized in our own words from these public reports. Credit goes to their authors.
Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change
Hit an error we don't cover? Submit it