TTMSMCPTools Class
The tools a server publishes. The collection owns its tools and is the list a client sees when it asks which tools are available.
API unit family: TMS.MCP.Tools
Inherits from: TTMSMCPOwnedCollection<TTMSMCPTool>
Syntax
TTMSMCPTools = class(TTMSMCPOwnedCollection<TTMSMCPTool>)
class PASCALIMPLEMENTATION TTMSMCPTools : public TTMSMCPOwnedCollection__1<TTMSMCPTool*>
Properties
| Name | Description |
|---|---|
| Items | Default indexed property giving access to the tools by position, so the collection can be indexed directly. Reading an item also rebinds it to the collection's owner. |
| Lock | Guards this collection's own registration methods (Add, Insert, RegisterTool) against a concurrent read of the collection, for example while tools/list is being served on another thread. |
Methods
| Name | Description |
|---|---|
| Add | Creates an empty tool, appends it to the collection and binds it to the collection's owner. |
| FindByName | Looks up a tool by the name it is published under. Comparison is case sensitive and the first match wins. |
| Insert | Creates an empty tool at a given position instead of appending it, so the published listing order can be controlled. |
| RegisterTool | Creates a tool from a name, a description and a callback in a single call, and appends it to the collection. |
Events
| Name | Description |
|---|---|
| OnChanged | Occurs whenever a tool in the collection is added, removed or modified. Use it to tell connected clients that the published tool listing has changed. |