Skip to content

McpServer builder extensions result in Tool InputSchema which isn't spec compliant #342

Closed
dotnet/extensions
#6465

Description

@PederHP

When using the JsonSchema from AIFunction additional properties not support by MCP are present. This can break clients which expect the Tool objects to follow the spec schema fully (InputSchema does not support additional properties).

GitHub Copilot (at least some versions of it) is an example of a client which will not accept the additional properties (e.g. "title", "description"). So even a minimalist MCP Server created using the README example or SDK samples will fail with such clients.

I'll have a PR with a fix soon. Just creating this for tracking purposes.

Activity

  1. self-assigned this
    on Apr 22, 2025
  2. eiriktsarpalis commented on May 19, 2025

    @eiriktsarpalis
    Member

    On second thought, I don't think it's realistic to remove keywords that are not type, properties, or required. JSON schema uses keywords like items, additionalProperties, enum, and anyOf to describe non-optional aspects of the schema of common input types.

    What's more though, the meta-schema as defined in the MCP specification does not explicitly prohibit additional properties (there is no "additionalProperties" : false declaration). The only requirement is specifying a "type": "object" keyword something we're already validating for. I think we want to double down on the posture that clients mandating only type, properties, or required keywords are not compliant per the MCP spec /cc @dsp-ant @jspahrsummers.

    In the meantime though, I can try filtering out the title and description keywords on the basis of them being duplicated in the containing tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions