TsgcWSAPIClient_MCP › Methods › RequestPrompt
Obtains the rendered content of a prompt template (prompts/get).
procedure RequestPrompt(const aName: string; const aArguments: IsgcJSON = nil);
| Name | Type | Description |
|---|---|---|
aName | const string | Identifier of the prompt to render, as published by the server in its prompts/list catalogue. |
aArguments | const IsgcJSON | Optional JSON payload supplying the values declared by the prompt. Pass nil for prompts that take no arguments. |
Sends the JSON-RPC prompts/get request. The server substitutes the supplied arguments into the template and returns a sequence of role-tagged messages. Results arrive through OnMCPResponsePrompt as a TsgcAI_MCP_Response_PromptsGet instance. The session must be in aimcpstInitialized state.
var
oArgs: IsgcJSON;
begin
oArgs := TsgcJSON.Create(nil);
oArgs.AddPair('code', 'ShowMessage(''Hello World'')');
MCP.RequestPrompt('CodeReview', oArgs);
end;