mcp: panic if AddTool method is given a nil InputSchema (#157)

The spec requires an input schema for every tool.
This commit is contained in:
Jonathan Amsterdam 2025-07-23 16:02:00 -04:00 • committed by GitHub
commit 8dd9a819bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -659,7 +659,7 @@ func TestCancellation(t *testing.T) {
return nil, nil
}
_, cs := basicConnection(t, func(s *Server) {
s.AddTool(&Tool{Name: "slow"}, slowRequest)
s.AddTool(&Tool{Name: "slow", InputSchema: &jsonschema.Schema{}}, slowRequest)
})
defer cs.Close()