Table of Contents

TTMSMCPCustomServer.CurrentSessionId Method

Returns the identifier of the session whose request is being handled on the calling thread, which is how a tool implementation learns which client it is serving.

API unit family: TMS.MCP.Server Declaring type: TTMSMCPCustomServer

Syntax

function CurrentSessionId: string;

Remarks

The value is thread-local and only set while a request is being dispatched, so it is empty outside a request. It is also empty on transports that have no concept of a session, such as standard input/output and named pipes.

Returns

Session identifier, or an empty string when there is none.