TMCPServer.Notify#
Enfileira uma notificação validada para os clientes do servidor.
Declaração#
function Notify(const Method: String; const ParamsJson: String): TMCPServer;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 {}. ParamsJson deve ser JSON válido e a fila é limitada. Requer mcp.server.use e mcp.server.notify.