TsgcWSAPIClient_MCP › Events › OnMCPListChanged

OnMCPListChanged Event

Fires when the server notifies that the tools, prompts or resources list changed.

Syntax

property OnMCPListChanged: TsgcAI_MCP_Client_OnListChangedEvent;
// TsgcAI_MCP_Client_OnListChangedEvent = procedure(Sender: TObject; aKind: TsgcAI_MCP_Client_ListChangedKind; const aNotification: string) of object

Default Value

—

Remarks

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.

Example

procedure TMainForm.MCPListChanged(Sender: TObject;
  aKind: TsgcAI_MCP_Client_ListChangedKind; const aNotification: string);
begin
  if aKind = aimcplckTools then
    Log('tools changed');
end;

Back to Events