Description
When calling an MCP tool that has all optional parameters (e.g., Playwright's browser_snapshot), and the LLM correctly decides to call it with no arguments (since none are required), OpenCode's harness rejects the call because it requires content.0.tool_use.input to be a non-empty object.
Expected behavior: The tool should be called successfully with an empty input {}, since the MCP tool schema declares all parameters as optional.
Actual behavior: The call fails because the harness enforces the presence of content[0].tool_use.input, which is absent or empty when no arguments are passed.
Example MCP tool affected:
{
"name": "playwright_browser_snapshot",
"parameters": {
"properties": {
"depth": { "type": "number", "description": "Limit the depth of the snapshot tree" },
"filename": { "type": "string", "description": "Save snapshot to markdown file..." }
},
"type": "object"
}
}
Note: no "required" array — both parameters are optional. Calling browser_snapshot() with no arguments is a perfectly valid invocation.
Workaround: The LLM must always pass at least one dummy parameter (e.g., depth=5) even when no arguments are needed, which is wasteful and fragile.
Root cause hypothesis: The harness validation likely checks for the existence/non-emptiness of tool_use.input without accounting for the case where all tool parameters are optional and the LLM correctly omits them.
Plugins
oh-my-opencode, Playwright MCP
OpenCode version
1.3.13
Steps to reproduce
- Configure an MCP server that exposes a tool with all-optional parameters (e.g., Playwright MCP's
browser_snapshot)
- Ask the LLM to take a page snapshot without specifying any parameters
- The LLM generates a tool call with no
input field (or empty input: {})
- OpenCode harness rejects the call
Screenshot and/or share link
{
"error": {
"code": 400,
"message": "{"type":"error","error":{"type":"invalid_request_error","message":"..content.0.tool_use.input: Field required"},"request_id":"req_vrtx_011CZefzKau4PEToWRYs5nXc"}",
"status": "INVALID_ARGUMENT"
}
}
(traceid: 5a8af7d0b37ea218fe88123c0d307dde)
Operating System
Linux
Terminal
OpenCode TUI
Description
When calling an MCP tool that has all optional parameters (e.g., Playwright's
browser_snapshot), and the LLM correctly decides to call it with no arguments (since none are required), OpenCode's harness rejects the call because it requirescontent.0.tool_use.inputto be a non-empty object.Expected behavior: The tool should be called successfully with an empty input
{}, since the MCP tool schema declares all parameters as optional.Actual behavior: The call fails because the harness enforces the presence of
content[0].tool_use.input, which is absent or empty when no arguments are passed.Example MCP tool affected:
{ "name": "playwright_browser_snapshot", "parameters": { "properties": { "depth": { "type": "number", "description": "Limit the depth of the snapshot tree" }, "filename": { "type": "string", "description": "Save snapshot to markdown file..." } }, "type": "object" } }Note: no
"required"array — both parameters are optional. Callingbrowser_snapshot()with no arguments is a perfectly valid invocation.Workaround: The LLM must always pass at least one dummy parameter (e.g.,
depth=5) even when no arguments are needed, which is wasteful and fragile.Root cause hypothesis: The harness validation likely checks for the existence/non-emptiness of
tool_use.inputwithout accounting for the case where all tool parameters are optional and the LLM correctly omits them.Plugins
oh-my-opencode, Playwright MCP
OpenCode version
1.3.13
Steps to reproduce
browser_snapshot)inputfield (or emptyinput: {})Screenshot and/or share link
{
"error": {
"code": 400,
"message": "{"type":"error","error":{"type":"invalid_request_error","message":"..content.0.tool_use.input: Field required"},"request_id":"req_vrtx_011CZefzKau4PEToWRYs5nXc"}",
"status": "INVALID_ARGUMENT"
}
}
(traceid: 5a8af7d0b37ea218fe88123c0d307dde)
Operating System
Linux
Terminal
OpenCode TUI