Fix example server elicitation conf#29
Merged
pcarleton merged 5 commits intomodelcontextprotocol:mainfrom Nov 20, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enables elicitation support in the example server and fixes the incorrect response schema validation for elicitation requests. The server previously validated client responses with a schema that incorrectly expected a method field, which only exists in requests, not responses.
- Added
elicitation: {}capability to server configuration - Fixed response schema validation for three elicitation tool implementations by replacing the incorrect
z.object({ method: z.literal('elicitation/create') }).passthrough()withz.any() as any
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
commit: |
Contributor
Author
|
Hey @felixweinberger could you please check this PR |
The elicitation/create response should be validated against ElicitResultSchema which ensures the response has the correct structure (action, content fields) rather than accepting any response. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Member
|
thanks for this @pbezglasny ! the schema was incorrect you're right. I switched it to the actual result rather than any
|
pcarleton
approved these changes
Nov 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For elicitation request fix checking response schema:
{ method: z.literal('elicitation/create') }as it is not part of client response.Similar thing is for sampling tool, but this PR does not change check.
conformance/examples/servers/typescript/everything-server.ts
Lines 311 to 314 in 5c15113
Also a question:
test_elicitationalways returns success result despite any errors, is it expected? If not I can update the PR.Motivation and Context
How Has This Been Tested?
Using mcp inspector
Breaking Changes
No
Types of changes
Checklist
Additional context