TsgcWSAPIServer_MCP › Methods › RequestRootsList
Sends a roots/list request to the MCP client identified by the session.
function RequestRootsList(const aSessionId: string): Boolean;
| Name | Type | Description |
|---|---|---|
aSessionId | const string | Identifier of the target MCP session, typically the value carried by the Mcp-Session-Id header. |
Returns True when the session exists and the request was dispatched over its streaming connection; False when the session is unknown or idle. (Boolean)
Issues a server-initiated roots/list JSON-RPC call to the client bound to the specified session. The reply is returned asynchronously through OnMCPResponseRootsList. Because the request flows client-bound, the transport must support streaming: enable TransportOptions.HttpStreamable (or keep an SSE connection open) so the session actually has an active connection to write on.
if not MCPServer.RequestRootsList(SessionId) then
MemoLog.Lines.Add('Session ' + SessionId + ' is not connected.');