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

Method ListRoots

mcp/server.go:1174–1179  ·  view source on GitHub ↗

ListRoots lists the client roots.

(ctx context.Context, params *ListRootsParams)

Source from the content-addressed store, hash-verified

1172
1173// ListRoots lists the client roots.
1174func (ss *ServerSession) ListRoots(ctx context.Context, params *ListRootsParams) (*ListRootsResult, error) {
1175 if err := ss.checkInitialized(methodListRoots); err != nil {
1176 return nil, err
1177 }
1178 return handleSend[*ListRootsResult](ctx, methodListRoots, newServerRequest(ss, orZero[Params](params)))
1179}
1180
1181// CreateMessage sends a sampling request to the client.
1182//

Callers 7

fileResourceHandlerFunction · 0.80
TestEndToEndFunction · 0.80
TestMiddlewareFunction · 0.80
TestNoJSONNullFunction · 0.80
Example_rootsFunction · 0.80
rootsToolFunction · 0.80

Calls 2

checkInitializedMethod · 0.95
newServerRequestFunction · 0.85

Tested by 5

TestEndToEndFunction · 0.64
TestMiddlewareFunction · 0.64
TestNoJSONNullFunction · 0.64
Example_rootsFunction · 0.64