Skip to content

fix(model): accept URL elicitation requests without elicitationId - #1383

Open
Iamsohungrynow wants to merge 1 commit into
modelcontextprotocol:mainfrom
Iamsohungrynow:fix/url-elicitation-optional-id
Open

Iamsohungrynow wants to merge 1 commit into
modelcontextprotocol:mainfrom
Iamsohungrynow:fix/url-elicitation-optional-id

Conversation

@Iamsohungrynow

@Iamsohungrynow Iamsohungrynow commented Oct 21, 2026 •

Copy link
Copy Markdown

2026-07-28 dropped elicitationId from url mode elicitation, so an input_required result with the spec's url example fell through to CustomResult and call_tool failed. a missing id now reads as empty and still goes out as "" for older clients, kept it a String so the public api doesn't change

@Iamsohungrynow
Iamsohungrynow requested a review from a team as a code owner October 21, 2026 16:11
@github-actions github-actions Bot added T-test Testing related changes T-config Configuration file changes T-core Core library changes T-model Model/data structure changes labels Oct 21, 2026
@github-actions
github-actions Bot requested a review from DaleSeo October 21, 2026 16:11
@github-actions

Copy link
Copy Markdown
Contributor

@DaleSeo (assignment failed) is on triage rotation this week and is the reviewer for this one.

Labels come from the PR labeler. Please review the change.

Automated triage. Labels are a first pass and the assigned maintainer has the final say.

Comment thread crates/rmcp/src/model.rs Outdated
/// The unique identifier for this elicitation request.
/// Protocol `2026-07-28` removed this field: it is empty when absent,
/// and an empty id is not serialized.
#[serde(skip_serializing_if = "String::is_empty")]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this skip, a server that builds URL parameters with an empty ID and sends them to a client released before 2026-07-28, now leaves out elicitationId, which the client still requires.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped the skip so an empty id still goes out as "", the test checks that now

Comment thread crates/rmcp/src/model.rs Outdated

#[test]
fn test_url_elicitation_without_elicitation_id() {
// 2026-07-28 removed `elicitationId` from URL mode requests.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This comment repeats the field's doc comment, and the test name already makes it clear what's being tested.

Suggested change
// 2026-07-28 removed `elicitationId` from URL mode requests.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed, and dropped the mrtr.rs test too since it went through the same parse path

2026-07-28 removed elicitationId from URL mode elicitation requests, so the
spec's own URL example failed to parse and an input_required result carrying
it fell through to CustomResult. A missing id now reads as empty and is still
serialized, so clients from before 2026-07-28 keep getting it; the field stays
a String so the public API is unchanged.
@Iamsohungrynow
Iamsohungrynow force-pushed the fix/url-elicitation-optional-id branch from d2c635b to 6660989 Compare October 28, 2026 18:28
@github-actions github-actions Bot removed the T-model Model/data structure changes label Oct 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-config Configuration file changes T-core Core library changes T-test Testing related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants