mcp: factor out reusable functions from TestStreamableServerTransport

The next CL will test stateless and distributable server transport
configurations, using the HTTP testing strategy of
TestStreamableServerTransport.
This commit is contained in:
Rob Findley 2025-08-14 23:49:25 +00:00 • committed by Robert Findley
commit 0eb03e0d76

View file

@ -355,6 +355,8 @@ func (s *Server) callTool(ctx context.Context, req *ServerRequest[*CallToolParam
if !ok {
return nil, fmt.Errorf("%s: unknown tool %q", jsonrpc2.ErrInvalidParams, req.Params.Name)
}
// TODO: if handler returns nil content, it will serialize as null.
// Add a test and fix.
return st.handler(ctx, req)
}