mcp: enforce input schema type "object" (#349)

The spec makes it clear that input schemas must have type "object".
Enforce that.
Allow "any" as an input argument type by special-casing it.

Fixes #283.
This commit is contained in:
Jonathan Amsterdam 2025-08-22 11:04:44 -04:00 • committed by GitHub
commit 18c96d6912
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -232,7 +232,7 @@ func TestServerPaginateVariousPageSizes(t *testing.T) {
}
func TestServerCapabilities(t *testing.T) {
tool := &Tool{Name: "t", InputSchema: &jsonschema.Schema{}}
tool := &Tool{Name: "t", InputSchema: &jsonschema.Schema{Type: "object"}}
testCases := []struct {
name string
configureServer func(s *Server)