Repository navigation
Conversation
|
This PR has been closed automatically. This repo only keeps pull requests open when they come from a maintainer, or from a contributor a maintainer has assigned to the linked issue, and you aren't currently assigned to #3883. If a maintainer assigns you to #3883, this PR reopens on its own and there's nothing more you need to do here. Assignment is a maintainer call based on capacity; comments that only ask to be assigned don't factor in. What does help is engaging on the issue itself by confirming the repro, explaining why it matters for your use case, or describing the approach you'd take. You're welcome to keep pushing commits here (just avoid force-pushing, since GitHub can't reopen a rewritten branch), but that on its own won't get the PR reviewed or the issue assigned, and realistically most auto-closed PRs stay closed. There's no need to open a new PR either way. CONTRIBUTING.md has the full reasoning, but in short:
Maintainers: reopen, remove |
Fixes #3883.
Root Cause
Pydantic emits
$defsand{"$ref": "#/$defs/..."}forStrEnumand(str, Enum)fields (both single-select andlist[Enum]multi-select).render_elicitation_schema()validated each property directly againstPrimitiveSchemaDefinition, which rejects$refand$defs.Changes
src/mcp/server/elicitation.py: Added_inline_string_enum_refs()inrender_elicitation_schema()to inline$refentries pointing to string enum definitions (type == "string"withenum) for both direct properties and arrayitems, removing inlined keys (and empty$defs) while keeping non-primitive/nested model rejections intact.tests/server/mcpserver/test_elicitation.py: Addedtest_render_elicitation_schema_inlines_string_enumscoveringStrEnum, optionalStrEnum | None,list[StrEnum],(str, Enum), and nestedBaseModelrejection.Verification
uv run pytest tests/server/mcpserver/test_elicitation.py tests/interaction/lowlevel/test_elicitation.py(50 passed)uv run ruff check src/mcp/server/elicitation.py tests/server/mcpserver/test_elicitation.pyuv run pyright src/mcp/server/elicitation.py tests/server/mcpserver/test_elicitation.py(0 errors)