TsgcWSAPIClient_MCPMethods › ListPrompts

ListPrompts Method

Retrieves the available prompt templates from the server (prompts/list).

Syntax

procedure ListPrompts(const aCursor: string = '');

Parameters

NameTypeDescription
aCursorconst stringOptional pagination cursor returned by a previous prompts/list response. Leave empty to request the first page.

Remarks

Sends the JSON-RPC prompts/list request. The reply is dispatched through OnMCPListPrompts as a TsgcAI_MCP_Response_PromptsList instance describing each prompt Name, Title, Description and declared arguments. The session must be in aimcpstInitialized state. Use the returned cursor to iterate paginated catalogues on servers that expose large prompt libraries.

Example

MCP.OnMCPListPrompts := procedure(Sender: TObject;
  const aRequest: TsgcAI_MCP_Request_PromptsList;
  const aResponse: TsgcAI_MCP_Response_PromptsList)
begin
  MemoPrompts.Lines.Text := aResponse.Write;
end;
MCP.ListPrompts;

Back to Methods