Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pbezglasny
Copy link
Contributor

@pbezglasny pbezglasny commented Nov 14, 2025

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.

z
.object({ method: z.literal('sampling/createMessage') })
.passthrough() as any
);

Also a question: test_elicitation always 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Copilot AI review requested due to automatic review settings November 14, 2025 00:11
Copy link

Copilot AI left a 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() with z.any() as any

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 17, 2025

Open in StackBlitz

npx https://pkg.pr.new/modelcontextprotocol/conformance/@modelcontextprotocol/conformance@29

commit: fffa835

@pbezglasny
Copy link
Contributor Author

Hey @felixweinberger could you please check this PR

pcarleton and others added 2 commits November 20, 2025 14:24
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]>
@pcarleton
Copy link
Member

thanks for this @pbezglasny ! the schema was incorrect you're right. I switched it to the actual result rather than any

test_elicitation would probably be good to return an error rather than success, I agree.

@pcarleton pcarleton merged commit 7f07556 into modelcontextprotocol:main Nov 20, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants