You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MCP tools being called with incorrect escaping for parameters #27079
After recent OpenCode updates, Qwen 3.6 35B-A3B now encounters the following:
The webfetch tool was called with invalid arguments: SchemaError(Expected "text" | "markdown" | "html", got "\"markdown\""
at ["format"]).
Please rewrite the input so it satisfies the expected schema.
This issue might be a duplicate of existing issues. Please check:
Tools with array/object parameters fail when LLM sends stringified JSON #7512: Tools with array/object parameters fail when LLM sends stringified JSON — same root cause where the LLM sends a parameter value with extra quoting/escaping (e.g. "\"markdown\"" instead of "markdown"), causing schema validation to fail
packages/opencode/src/tool/webfetch.ts, line 20:
remove .pipe(Schema.optional, Schema.withDecodingDefault(Effect.succeed("markdown" as const))),
Should look like this:
exportconstParameters=Schema.Struct({url: Schema.String.annotate({description: "The URL to fetch content from"}),format: Schema.Literals(["text","markdown","html"]).annotate({description: "The format to return the content in (text, markdown, or html). Defaults to markdown.",default: "markdown",}),timeout: Schema.optional(Schema.Number).annotate({description: "Optional timeout in seconds (max 120)"}),})
The original version sends this schema.format:
"format": {
"anyOf": [
{
"type": "string",
"enum": [
"text",
"markdown",
"html"
],
"description": "The format to return the content in (text, markdown, or html). Defaults to markdown.",
"default": "markdown"
},
{
"type": "null"
}
]
}
Fixed:
"format": {
"type": "string",
"enum": [
"text",
"markdown",
"html"
],
"description": "The format to return the content in (text, markdown, or html). Defaults to markdown.",
"default": "markdown"
}
The workaround I found was to create a custom rules markdown with the following:
## webfetch Tool Usage
When calling the `webfetch` tool, **never** include the `format` parameter. Omitting it defaults to `markdown`, which is the desired behavior. Only provide the `url` parameter.
**Correct:**
```json
{
"url": "https://example.com"
}
```
I added this line in my opencode.jsonc to make it universal, but you could just add it to your AGENTS.md or whatever. "instructions": ["~/.config/opencode/custom_rules.md"],
Activity
github-actions commentedon May 12, 2026
This issue might be a duplicate of existing issues. Please check:
"\"markdown\""instead of"markdown"), causing schema validation to faillowlyocean commentedon May 12, 2026
It isn't a duplicate of those
lznoob commentedon May 15, 2026
packages/opencode/src/tool/webfetch.ts, line 20:
remove
.pipe(Schema.optional, Schema.withDecodingDefault(Effect.succeed("markdown" as const))),Should look like this:
The original version sends this schema.format:
Fixed:
Not sure what exactly is wrong, though.
lowlyocean commentedon May 15, 2026
@kitlangton Looks like your recent PR a few days ago may have introduced a regression as indicated above, can you check please?
#26956
frankfletcher commentedon May 31, 2026
same issue.
OpenCode v1.15.13
Ubuntu Linux v26.04
Qwen 3.6 27b running on beellama.cpp server.
frankfletcher commentedon Jun 1, 2026
The workaround I found was to create a custom rules markdown with the following:
I added this line in my opencode.jsonc to make it universal, but you could just add it to your AGENTS.md or whatever.
"instructions": ["~/.config/opencode/custom_rules.md"],nexxeln commentedon Jun 1, 2026
will be fixed in next release!