TsgcWSAPIServer_MCP › Methods › HasClientCapability

HasClientCapability Method

Returns True when the client of the request declared a capability.

Syntax

function HasClientCapability(const aSession: TsgcAI_MCP_Session; const aCapability: string): Boolean;

Remarks

For a 2026-07-28 request the capability is looked up in the client capabilities sent in params._meta, so any key can be checked (for example elicitation, sampling or roots). For a legacy session the capabilities negotiated by initialize are used and the supported values are elicitation, sampling and roots. Returns False when aSession is nil. See Protocol Versions.

Example

if MCPServer.HasClientCapability(aSession, 'roots') then
  aResponse.InputRequired.AddRoots('roots');

Back to Methods