TsgcWSAPIClient_MCPMethods › RequestPrompt

RequestPrompt Method

Obtains the rendered content of a prompt template (prompts/get).

Syntax

procedure RequestPrompt(const aName: string; const aArguments: IsgcJSON = nil);

Parameters

NameTypeDescription
aNameconst stringIdentifier of the prompt to render, as published by the server in its prompts/list catalogue.
aArgumentsconst IsgcJSONOptional JSON payload supplying the values declared by the prompt. Pass nil for prompts that take no arguments.

Remarks

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.

Example

var
  oArgs: IsgcJSON;
begin
  oArgs := TsgcJSON.Create(nil);
  oArgs.AddPair('code', 'ShowMessage(''Hello World'')');
  MCP.RequestPrompt('CodeReview', oArgs);
end;

Back to Methods