Table of Contents

TTMSMCPPrompt Class

A reusable, named conversation template that a client can ask for by name and expand with its own values.

API unit family: TMS.MCP.Prompts Inherits from: TTMSMCPBase

Syntax

TTMSMCPPrompt = class(TTMSMCPBase)

Remarks

A prompt publishes its name, description and the arguments it needs; expanding it runs the assigned handler, which turns the supplied values into the messages that are handed back. Asking for a name that is not registered is reported as a prompt that was not found, error code -32003, and a handler that fails is reported as a failed operation, error code -32004.

Properties

Name Description
Arguments Values the prompt asks for before it can be expanded.
Description Text telling a model what the prompt is for and when to reach for it. Left out of the descriptor when empty.
IconsJSON Icon descriptors published with the prompt, serialized as a JSON array.
Name Identifier clients ask for the prompt by. Must be unique within its collection.
Title Display name a client shows for the prompt, as opposed to the identifier it is asked for by. Left out of the descriptor when empty.

Methods

Name Description
CreateBuilder Creates a builder for describing a prompt through chained calls.
Execute Runs the handler and returns the conversation it produced.
GetPrompt Expands the prompt for one client request: checks the supplied values, runs the handler, and builds the answer.
ToJSON Builds the descriptor published for this prompt in a listing.

Events

Name Description
PromptMethod Code that turns the supplied argument values into the conversation this prompt stands for.

Used by