TTMSMCPServer.FlagToolCallError Method
Marks the tool call running on the calling thread as failed, so the response carries an error flag while still returning the content the tool produced.
API unit family: TMS.MCP.Server
Declaring type: TTMSMCPServer
Inherited from: TTMSMCPCustomServer
Syntax
procedure FlagToolCallError;
Remarks
A failed tool call is reported as a normal result with the error flag set rather than as a protocol-level error, which is what lets the calling model read the failure text. Raising an exception from the tool has the same effect but replaces the content with the exception message; use this procedure when the tool should choose its own error content.