Table of Contents

TTMSMCPPrompt.GetPrompt Method

Expands the prompt for one client request: checks the supplied values, runs the handler, and builds the answer.

API unit family: TMS.MCP.Prompts Declaring type: TTMSMCPPrompt

Syntax

function GetPrompt(const AArguments: TJSONObject): TJSONObject;

Remarks

Values are matched to arguments by name and then passed positionally in declaration order; an argument the client left out is passed as an empty value. Every value is converted as text whatever it was sent as. Values for names the prompt does not declare are ignored.

Parameters

Name Description
AArguments Values supplied by the client, keyed by argument name. May be nil, which is treated as no values at all. The object stays owned by the caller.

Returns

A new object carrying the description, when the prompt has one, and the message list. The caller owns the returned object.

Exceptions

Exception Description
EJsonRpcException Raised with internal-error, code -32603, when no handler is assigned; with invalid-parameters, code -32602, when a required argument is missing or a supplied value cannot be converted; and with failed-operation, code -32004, when the handler itself fails. A protocol error raised inside the handler is passed through with its own code intact.