TsgcWSAPIClient_MCP › Methods › ListPrompts
Retrieves the available prompt templates from the server (prompts/list).
procedure ListPrompts(const aCursor: string = '');
| Name | Type | Description |
|---|---|---|
aCursor | const string | Optional pagination cursor returned by a previous prompts/list response. Leave empty to request the first page. |
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.
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;