-
Notifications
You must be signed in to change notification settings - Fork 10
Fix example server elicitation conf #29
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
Fix example server elicitation conf #29
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
|
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 <[email protected]>
|
thanks for this @pbezglasny ! the schema was incorrect you're right. I switched it to the actual result rather than any
|
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