GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Bug: MCP tools with all-optional parameters fail when called without arguments — harness requires content.0.tool_use.input to be present · Issue #20637 · anomalyco/opencode

Bug: MCP tools with all-optional parameters fail when called without arguments — harness requires content.0.tool_use.input to be present #20637

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Bug: MCP tools with all-optional parameters fail when called without arguments — harness requires content.0.tool_use.input to be present#20637
Copy link
Assignees
kitlangton

Description

@D26FORWARD
D26FORWARD
opened on Apr 2, 2026
Issue body actions

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

  1. Configure an MCP server that exposes a tool with all-optional parameters (e.g., Playwright MCP's browser_snapshot)
  2. Ask the LLM to take a page snapshot without specifying any parameters
  3. The LLM generates a tool call with no input field (or empty input: {})
  4. 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)

Image

Operating System

Linux

Terminal

OpenCode TUI

Reacted by rupuin

Activity

  1. github-actions
    assigned
    rekram1-node
    on Apr 2, 2026
  2. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 2, 2026
  3. github-actions commented on Apr 2, 2026

    @github-actions
    github-actionsBot
    on Apr 2, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • MCP tool wrappers send extra _placeholder param causing ZodError in Supabase MCP + empty response in PythonAnywhere MCP #15041: MCP tool wrappers send extra _placeholder param 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.
  4. thdxr
    assigned
    kitlangton
    and unassigned
    rekram1-node
    on May 3, 2026
  5. thdxr
    removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. github-actions commented on Jul 3, 2026

    @github-actions
    github-actionsBot
    on Jul 3, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  7. github-actions
    closed this as not plannedon Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @kitlangton
    kitlangton

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.