MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / handleSend

Function handleSend

mcp/shared.go:136–145  ·  view source on GitHub ↗
(ctx context.Context, method string, req Request)

Source from the content-addressed store, hash-verified

134}
135
136func handleSend[R Result](ctx context.Context, method string, req Request) (R, error) {
137 mh := req.GetSession().sendingMethodHandler()
138 // mh might be user code, so ensure that it returns the right values for the jsonrpc2 protocol.
139 res, err := mh(ctx, method, req)
140 if err != nil {
141 var z R
142 return z, err
143 }
144 return res.(R), nil
145}
146
147// defaultReceivingMethodHandler is the initial MethodHandler for servers and clients, before being wrapped by middleware.
148func defaultReceivingMethodHandler[S Session](ctx context.Context, method string, req Request) (Result, error) {

Callers

nothing calls this directly

Calls 2

sendingMethodHandlerMethod · 0.65
GetSessionMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…