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
Bug: MCP tools with all-optional parameters fail when called without arguments — harness requires content.0.tool_use.input to be present #20637
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: {})
Activity
github-actions commentedon Apr 2, 2026
This issue might be a duplicate of existing issues. Please check:
_placeholderparam causing ZodError in Supabase MCP + empty response in PythonAnywhere MCP #15041: MCP tool wrappers send extra_placeholderparam causing failures — describes the same root cause where OpenCode sends{ _placeholder: true }instead of an empty{}for tools with no required parameters, which directly relates to the harness rejecting calls with no input arguments.github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.