TMCPClient.ListPrompts#
Retorna um array JSON limitado com os prompts anunciados pelo servidor conectado.
Declaração#
function ListPrompts: String;Exemplo#
uses Odisseia.Mcp;
function Greeting(const Context: TMCPCallContext; const ArgumentsJson: String): String;
begin Result := '{"messages":[]}' end;
var Server: TMCPServer; Client: TMCPClient;
begin
Server := TMCPServer.Create;
Server.Transport('inprocess');
Server.Endpoint('mcp-local');
Server.Prompt('greeting', Greeting);
Server.Start;
Client := TMCPClient.Create.Connect;
WriteLn(Client.ListPrompts);
Client.Close;
Server.Close
end.A saída contém o campo name com greeting. Sem prompts registrados, retorna []. Requer mcp.client.use.