go-sdk icon indicating copy to clipboard operation
go-sdk copied to clipboard

mcp: don't treat pointers differently given an OutputSchema override

Open findleyr opened this issue 11 months ago • 1 comments

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:

  1. If the user provides a schema, it must be an "object" schema.
  2. 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

findleyr avatar Dec 05 '25 23:12 findleyr

Closing as outdated

guglielmo-san avatar Oct 27 '26 11:10 guglielmo-san