TMCPClient.NextNotification#
Retira e retorna a próxima notificação JSON enfileirada pelo servidor.
Declaração#
function NextNotification: String;Exemplo#
uses Odisseia.Mcp;
var Server: TMCPServer; Client: TMCPClient;
begin
Server := TMCPServer.Create;
Server.Transport('inprocess');
Server.Endpoint('mcp-local');
Server.Start;
Client := TMCPClient.Create.Connect;
Server.Notify('tools/list_changed', '{}');
WriteLn(Client.NextNotification);
Client.Close;
Server.Close
end.A saída contém method igual a tools/list_changed e params igual a {}. Retorna uma string vazia quando não há notificações. Requer mcp.client.use.