Table of Contents

TTMSMCPTool.ExecuteMethod Method

Runs the tool for an incoming call and converts its result to JSON. Required parameters are validated and every supplied parameter is converted to the declared type before the callback runs; string values are coerced to a number or a Boolean where the parameter declares one. The name-keyed callback is used when one is assigned, otherwise the positional one, and the returned value is converted using the tool's return type.

API unit family: TMS.MCP.Tools Declaring type: TTMSMCPTool

Syntax

function ExecuteMethod(const AJsonParams: TJSONObject): TJSONValue;

Parameters

Name Description
AJsonParams The arguments object of the call, or nil when the call carried none. Ownership stays with the caller.

Returns

A newly created JSON value holding the converted result, owned by the caller.

Exceptions

Exception Description
EJsonRpcException Raised with an invalid-parameters code when a required parameter is missing or a value does not match its declared type, and with an operation-failed code when the callback or the result conversion fails.