Table of Contents

TTMSMCPClient Class

Component that connects a model to one or more servers, so the model can call the tools those servers publish while answering a query.

API unit family: TMS.MCP.Client Inherits from: TTMSMCPCustomClient

Syntax

TTMSMCPClient = class(TTMSMCPCustomClient)

Remarks

Configure the servers in Servers, choose the model service and supply its access key, then submit a question with Execute and read the answer in OnExecuted.

Properties

Name Description
APIKeys Access keys for the supported model services. (inherited from TTMSMCPCustomClient)
ClientName Name this client reports to every server during the handshake. (inherited from TTMSMCPCustomClient)
ClientVersion Version this client reports to every server during the handshake. (inherited from TTMSMCPCustomClient)
LLM Model connection the client owns, for settings that are not surfaced directly on the client. (inherited from TTMSMCPCustomClient)
LogFileName File that log records are appended to. (inherited from TTMSMCPCustomClient)
Logging Determines whether log records are appended to the file named by LogFileName: True writes each record to that file, False, the default, writes nothing. (inherited from TTMSMCPCustomClient)
Servers Servers this client talks to. (inherited from TTMSMCPCustomClient)
Service Model service the client sends its queries to. (inherited from TTMSMCPCustomClient)
Settings Request settings used when querying the model, such as the model name and the sampling parameters. (inherited from TTMSMCPCustomClient)
ToolCallMode Decides whether a tool invocation requested by the model is refused or allowed when no approval handler decides otherwise. (inherited from TTMSMCPCustomClient)
ToolCallTimeout How long, in milliseconds, the client waits for a server to answer a tool invocation. (inherited from TTMSMCPCustomClient)
ToolDeniedMessage Text handed back to the model in place of a result when a tool invocation is refused. (inherited from TTMSMCPCustomClient)
Tools Tool definitions offered to the model. (inherited from TTMSMCPCustomClient)
Version Version of the component itself, as four dot-separated numbers. (inherited from TTMSMCPCustomClient)

Methods

Name Description
Execute Sends a query to the model, letting it call the tools the connected servers publish. (inherited from TTMSMCPCustomClient)

Events

Name Description
OnBeforeUseTool Occurs before each tool invocation the model requests, so the application can approve or refuse it. (inherited from TTMSMCPCustomClient)
OnCreateIOHandler Occurs while a network transport prepares its connection, so the application can supply its own input/output handler. (inherited from TTMSMCPCustomClient)
OnExecuted Occurs when a query submitted with Execute has produced its answer. (inherited from TTMSMCPCustomClient)
OnLog Occurs for every log record the client produces, whether or not logging to file is enabled. (inherited from TTMSMCPCustomClient)

Used by