Skip to content

[FEATURE]: outputSchema for mcp tools should be exposed to LLM #27577

Closed as not planned

Description

@bo-tato

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

For MCP tools, the optional outputSchema provides information about the output to expect from the tool. But opencode is not including this in context, only the tool description. According to the MCP spec:

Providing an output schema helps clients and LLMs understand and properly handle structured tool outputs by:
...
Guiding clients and LLMs to properly parse and utilize the returned data

so I think the information from tool's outputSchema should be included in the LLM context in some way.

Activity

  1. changed the title [-][FEATURE]: output_schema (in some format) for mcp tools should be exposed to LLM[/-] [+][FEATURE]: outputSchema for mcp tools should be exposed to LLM[/+] on May 14, 2026
  2. rekram1-node commented on May 14, 2026

    @rekram1-node
    Collaborator

    wdym, im pretty sure we respect this can u show me how we arent?

  3. bo-tato commented on May 14, 2026

    @bo-tato
    ContributorAuthor

    previously I'd checked making manual curl requests to my MCP server that it was returning the outputSchema with descriptions, and asked the LLM in opencode for full description it had of the MCP tool, and if it sees "string from description of output parameter" anywhere in it's context, and it said it didn't see the string, and the description it returned was the tool description without anything about the outputSchema. then I searched issues for outputSchema and found #21591 where someone (well with emdash so probably an llm) says "opencode doesn't use outputSchema — it only reads inputSchema in convertMcpTool()".

    and just now to be completely sure I ran opencode through mitmproxy, and for the MCP tool it is sending:

    {
                "type": "function",
                "name": "mcp_tool_name",
                "description": "tool description",
                "parameters": {
                        ...info from inputSchema here...
                }
    },
    

    but the outputSchema is not present, and searching the strings from the descriptions in the outputSchema with mitmproxy they are not being sent at all

  4. rekram1-node commented on May 15, 2026

    @rekram1-node
    Collaborator

    oh ic what ur saying now i was misunderstanding

  5. github-actions commented on Jul 14, 2026

    @github-actions
    Contributor

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

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