TTMSMCPPrompts Class
The set of prompts a server publishes.
API unit family: TMS.MCP.Prompts
Inherits from: TOwnedCollection
Syntax
TTMSMCPPrompts = class(TOwnedCollection)
Remarks
The collection owns its prompts and frees them, so a prompt obtained from it must never be freed by the caller; the registration methods likewise copy what they are given instead of adopting it. Adding or removing a prompt raises the change event, which a server uses to tell connected clients that the list moved — but only when it advertises prompt list-change notifications; with that switch off the notification is a silent no-op. Editing a property of a prompt that is already in the collection does not mark the collection as changed.
Properties
| Name | Description |
|---|---|
| Items | Prompts in the collection, addressed by their position. |
| Lock | Guards this collection's own registration methods (Add, AddPrompt, RegisterPrompt) against a concurrent read of the collection, for example while prompts/list is being served on another thread. |
Methods
| Name | Description |
|---|---|
| Add | Appends an empty prompt and returns it so its properties can be filled in. |
| AddPrompt | Validates a prompt and appends a copy of it to the collection. |
| FindByName | Looks up a prompt by the identifier clients ask for it by. |
| RegisterPrompt | Publishes a prompt that takes no declared arguments in a single call. |
Events
| Name | Description |
|---|---|
| OnChanged | Occurs when the set of prompts changes, so anything derived from the list can be refreshed. |