TsgcWSAPIClient_MCP › Events › OnMCPListChanged
Fires when the server notifies that the tools, prompts or resources list changed.
property OnMCPListChanged: TsgcAI_MCP_Client_OnListChangedEvent;
// TsgcAI_MCP_Client_OnListChangedEvent = procedure(Sender: TObject; aKind: TsgcAI_MCP_Client_ListChangedKind; const aNotification: string) of object
—
aKind is aimcplckTools, aimcplckPrompts or aimcplckResources and aNotification is the raw JSON of the notification. Call ListTools, ListPrompts or ListResources to refresh the catalogue. In the protocol version 2026-07-28 the notifications arrive through a subscription opened with SubscriptionsListen.
With the HTTP transports the event runs in a background thread; use TThread.Queue or TThread.Synchronize to update visual controls. See Subscriptions.
procedure TMainForm.MCPListChanged(Sender: TObject;
aKind: TsgcAI_MCP_Client_ListChangedKind; const aNotification: string);
begin
if aKind = aimcplckTools then
Log('tools changed');
end;