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:
parent
732b97fdaf
commit
0eb03e0d76
1 changed files with 182 additions and 187 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue