modelcontextprotocol / modelcontextprotocol/go-sdk
Fix handling for nil pointers given user-provided output schema
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.1k
- Forks
- 543
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 37
Description
Following up on some discussion in #685: When fixing #199, I was overly cautious about handling typed nils: if the user provided their own output schema, we wouldn't fix typed nils for them, and so returning 'nil' would result in a missing structured output, rather than its zero value.
This was wrong: switching from an inferred schema to a user-provided schema shouldn't change the handling of nil, and structured output, if provided, must be an object.
PR incoming.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading issues #199 and #685 for the prior typed-nil handling discussion, then locate the implementation and tests covering user-provided output schemas. Verify that nil values are handled consistently with inferred schemas and that structured output remains an object; the issue notes that a PR is incoming.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100