go-sdk
go-sdk copied to clipboard
mcp: don't treat pointers differently given an OutputSchema override
In the fix for https://github.com/modelcontextprotocol/go-sdk/issues/199, I was overly cautious: I assumed that if the user provided their own schema, we shouldn't fix up typed nils for them.
But this was wrong: consider that:
- If the user provides a schema, it must be an "object" schema.
- One way that we recommend customizing schemas is by calling jsonschema.For and modifying. It's very confusing that doing this would change the treatment of the zero value.
The good news is that any tool that was returning a typed nil is provably wrong, so this is just a bug that we can and should fix.
Fixes #691
Closing as outdated