Skip to content

MCP tool schema optional fields become required in OpenCode (jira_add_comment) #20661

Closed

Description

@tarasovmo

Description

What happened

In OpenCode 1.3.13, MCP tool jira_add_comment is treated as if optional fields are required.
As a result, the model sends extra args like:

  • visibility: ""
  • public: false
    and receives server validation errors (e.g. visibility must be valid JSON object).

Expected behavior

For jira_add_comment, only:

  • issue_key
  • body
    should be required. visibility and public must stay optional.

Environment

  • OpenCode: 1.3.13
  • Model: gpt-5.3-codex
  • MCP Jira server: ghcr.io/sooperset/mcp-atlassian:latest
    • image version: 0.21.0
    • revision: c450a161ec630dd57f44a2b15d977debae19eba5

Evidence: raw MCP schema is correct

Direct Jira MCP endpoint

tools/list for jira_add_comment returns:

"inputSchema": {
  "required": ["issue_key", "body"],
  "properties": {
    "visibility": { "type": "string", "default": null },
    "public": { "type": "boolean", "default": null }
  }
}

Evidence: OpenCode behavior
In OpenCode session data, actual tool calls include optional params even when not requested:
{
  "tool": "jira_jira_add_comment",
  "input": {
    "issue_key": "xxx",
    "body": "Test",
    "visibility": "",
    "public": false
  }
}
This leads to validation error from MCP Jira:
visibility must be a valid JSON object ...

Suspected root cause
OpenCode MCP tool adapter / tool registry path likely mutates or ignores optional/nullability in incoming inputSchema, causing optional fields to be treated as required (or aggressively auto-filled).

### Plugins

/sooperset/mcp-atlassian

### OpenCode version

1.3.13

### Steps to reproduce

1. Configure remote MCP Jira.
2. Ask model:  write comment "Test" for task xxx
3. Observe tool call args include visibility/public despite not being requested.
4. Observe comment-add failure until fallback/workaround is used.

### Screenshot and/or share link

<img width="1032" height="240" alt="Image" src="https://github.com/user-attachments/assets/65b4a771-6c6b-48b2-820c-746eef5aa8a5" />

### Operating System

Windows 11

### Terminal

_No response_

Activity

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

    @github-actions
    Contributor

    This issue might be related to an existing issue. Please check:

  3. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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