Table of Contents

Prompts

A prompt is a reusable, argument-driven conversation opener that an MCP server publishes and a user picks — a slash command, an entry in a prompt palette, a "summarize this" button. Unlike a tool, which the model chooses, a prompt is chosen by a person, who fills in its declared arguments; the handler then returns a short conversation that the client inserts into the chat. TTMSMCPPrompt covers the whole surface: named and described prompts, required and optional arguments, a fluent builder, display titles and icons, multi-turn user/assistant message collections, runtime list changes with client notifications, and argument-value completion.

Documentation

Start here Use when
Getting started You want a working prompt on a server quickly.
User guide You want task-oriented chapters grouped by feature area.
API reference You want exact class, property, method, and event contracts.
Release notes You want the version history for this component.

Key classes

Class Role
TTMSMCPPrompt A single prompt: name, title, description, arguments, icons, and the handler that builds its messages.
TTMSMCPPrompts The collection of prompts owned by a server. Register, add, and find prompts here.
TTMSMCPPromptArgument One declared argument: name, description, and required flag.
TTMSMCPPromptArguments The collection of arguments on a prompt; declaration order is argument order.
TTMSMCPPromptMessage One message in the returned conversation: role, content type, and text.
TTMSMCPPromptMessages The message collection a handler builds and returns.
TTMSMCPPromptBuilder Fluent builder for declaring a prompt in a single expression.
TTMSMCPPromptArgumentBuilder Fluent builder for one argument, returned by AddArgument.

Minimal example

procedure TForm1.RegisterSummarizePrompt;
var
  Arg: TTMSMCPPromptArgument;
begin
  { Server is a TTMSMCPServer dropped on the form. }
  Server.Prompts.RegisterPrompt('summarize_ticket',
    'Asks the model to summarize a support ticket in three sentences',
    function(const Args: array of TValue): TTMSMCPPromptMessages
    begin
      Result := TTMSMCPPromptMessages.Create(nil);
      Result.AddUserMessage(Format(
        'Summarize support ticket %s in three sentences.', [Args[0].AsString]));
    end);

  { RegisterPrompt declares no arguments, so declare them separately -
    the client needs them to build the prompts/get call. }
  Arg := Server.Prompts.FindByName('summarize_ticket').Arguments.Add;
  Arg.Name := 'ticket_id';
  Arg.Description := 'Identifier of the ticket to summarize';
  Arg.Required := True;
end;

API map

Role Types
Prompt and collection TTMSMCPPrompt, TTMSMCPPrompts
Argument declaration TTMSMCPPromptArgument, TTMSMCPPromptArguments
Returned conversation TTMSMCPPromptMessage, TTMSMCPPromptMessages
Fluent construction TTMSMCPPromptBuilder, TTMSMCPPromptArgumentBuilder
Handler callbacks TTMSMCPPromptMethod, TTMSMCPPromptMethodEvent
Server integration TTMSMCPPromptsListEvent, TTMSMCPCompletionEvent
Shared base TTMSMCPBase

Guides

Guide Covers
Defining prompts Registration, the fluent builder, arguments, titles and icons, runtime listing, and change notifications.
Prompt messages Reading arguments, message roles, ownership of the returned collection, multi-turn openings, and argument completion.

See Also