Skip to content

Remove title and description keywords from root-level schemas in AIFunctionFactory. #6465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2025

Conversation

eiriktsarpalis
Copy link
Member

@eiriktsarpalis eiriktsarpalis commented May 20, 2025

As an alternative solution to modelcontextprotocol/csharp-sdk#436, this PR removes the title and description keywords from root-level schemas in AIFunctionFactory. This is due to the fact both keywords are already represented in the resultant AIFunction via the Name and Description properties respectively, and because keywords beyond type, properties, and required is known to create problems with certain clients in the context of MCP.

Because both the name and description keywords are optional in the schema, I do not consider this to be a breaking change.

Fix modelcontextprotocol/csharp-sdk#342. Supersedes modelcontextprotocol/csharp-sdk#436

@stephentoub
Copy link
Member

I'm happy with the change, but what changed your opinion since #5826 (comment)... that it breaks some consumers?

@eiriktsarpalis
Copy link
Member Author

what changed your opinion since #5826 (comment)... that it breaks some consumers?

We had no reports of this creating issues with consumers until modelcontextprotocol/csharp-sdk#342.

@eiriktsarpalis eiriktsarpalis merged commit 6ae09b8 into dotnet:main May 20, 2025
7 checks passed
@eiriktsarpalis eiriktsarpalis deleted the remove-description-title branch May 20, 2025 12:17
@github-actions github-actions bot locked and limited conversation to collaborators Jun 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-ai Microsoft.Extensions.AI libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

McpServer builder extensions result in Tool InputSchema which isn't spec compliant
2 participants