Skip to main content
Table of Contents

TTMSMCPToolAttribute Class

Marks a method as a callable tool.

API unit family: TMS.MCP.Attributes Inherits from: TTMSMCPCustomAttribute Implements: ITMSMCPToolAttribute

Syntax

GeneratedPascalC++
TTMSMCPToolAttribute = class(TTMSMCPCustomAttribute, ITMSMCPToolAttribute)
class PASCALIMPLEMENTATION TTMSMCPToolAttribute : public TTMSMCPCustomAttribute, public ITMSMCPToolAttribute

Remarks

This attribute is what makes a method reachable. Both public and published methods are discovered, because the default RTTI settings emit both visibilities. When the method carries no name attribute it is published as <ClassName>_<MethodName>, and when it carries no type attribute the result type is derived from the method signature, with a procedure published as returning a boolean.

Examples

Pascal
[TTMSMCPToolAttribute]
[TTMSMCPNameAttribute('add_numbers')]
[TTMSMCPDescriptionAttribute('Adds two numbers and returns the sum.')]
[TTMSMCPReadOnlyAttribute]
function Add(A, B: Integer): Integer;

Used by