all: remove ServerRequest[T] for concrete T (#342)

Replace all occurrences of ServerRequest[*CallToolParams] and other
concrete instantiations with CallToolRequest and the like.

Make the XXXRequest types aliases, to preserve the convenience of
generics for the internal machinery (see shared.go, for example.)

I will expand the aliases in a followup PR.
This commit is contained in:
Jonathan Amsterdam 2025-08-21 12:10:53 -04:00 • committed by GitHub
commit 6378df6f24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -282,10 +282,10 @@ func TestServerCapabilities(t *testing.T) {
s.AddResourceTemplate(&ResourceTemplate{URITemplate: "file:///rt"}, nil)
},
serverOpts: ServerOptions{
SubscribeHandler: func(context.Context, *ServerRequest[*SubscribeParams]) error {
SubscribeHandler: func(context.Context, *SubscribeRequest) error {
return nil
},
UnsubscribeHandler: func(context.Context, *ServerRequest[*UnsubscribeParams]) error {
UnsubscribeHandler: func(context.Context, *UnsubscribeRequest) error {
return nil
},
},
@ -308,7 +308,7 @@ func TestServerCapabilities(t *testing.T) {
name: "With completions",
configureServer: func(s *Server) {},
serverOpts: ServerOptions{
CompletionHandler: func(context.Context, *ServerRequest[*CompleteParams]) (*CompleteResult, error) {
CompletionHandler: func(context.Context, *CompleteRequest) (*CompleteResult, error) {
return nil, nil
},
},
@ -326,13 +326,13 @@ func TestServerCapabilities(t *testing.T) {
s.AddTool(tool, nil)
},
serverOpts: ServerOptions{
SubscribeHandler: func(context.Context, *ServerRequest[*SubscribeParams]) error {
SubscribeHandler: func(context.Context, *SubscribeRequest) error {
return nil
},
UnsubscribeHandler: func(context.Context, *ServerRequest[*UnsubscribeParams]) error {
UnsubscribeHandler: func(context.Context, *UnsubscribeRequest) error {
return nil
},
CompletionHandler: func(context.Context, *ServerRequest[*CompleteParams]) (*CompleteResult, error) {
CompletionHandler: func(context.Context, *CompleteRequest) (*CompleteResult, error) {
return nil, nil
},
},