Skip to content

fix: check_capability now validates elicitation sub-capabilities (form/url)#2966

Closed
Robin1987China wants to merge 1 commit into
modelcontextprotocol:mainfrom
Robin1987China:fix/elicitation-subcap-check
Closed

fix: check_capability now validates elicitation sub-capabilities (form/url)#2966
Robin1987China wants to merge 1 commit into
modelcontextprotocol:mainfrom
Robin1987China:fix/elicitation-subcap-check

Conversation

@Robin1987China

Copy link
Copy Markdown

Summary

Closes #2965

Connection.check_capability() only checked the top-level elicitation key — if the client declared ANY elicitation support, all sub-capability checks passed. A client supporting only URL elicitation would incorrectly return True when checked for form elicitation.

Fix

Added form / url sub-capability checks matching the existing sampling sub-capability pattern (.context / .tools).

Tests

5 new parametrized test cases covering:

  • Client has no elicitation → check fails
  • Client has form only, check for url → fails
  • Client has url only, check for form → fails
  • Client has both, check for one → passes
  • Client has form, check for form → passes

AI assistance: Bug discovered, analyzed, and fix implemented with AI assistance (opencode).

…m/url)

Schema has ElicitationCapability.form and .url sub-fields but
check_capability only validated the top-level elicitation key.
A client that supports URL elicitation but not form elicitation
would incorrectly return True when the caller checks for form.

Fix matches the existing sampling sub-capability pattern.
@maxisbey maxisbey closed this Jun 25, 2026
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.

[Bug] check_capability does not validate elicitation sub-capabilities (form/url)

2 participants