TsgcWSAPIClient_MCPMethods › ListTools

ListTools Method

Requests the catalogue of tools published by the server (tools/list).

Syntax

procedure ListTools(const aCursor: string = '');

Parameters

NameTypeDescription
aCursorconst stringOptional pagination cursor returned by a previous tools/list response. Leave empty to request the first page.

Remarks

Sends the JSON-RPC tools/list request. The reply is dispatched through OnMCPListTools as a TsgcAI_MCP_Response_ToolsList instance that exposes each tool Name, Title, Description and JSON schema. Use the nextCursor field of the response to iterate paginated catalogues. The session must be in aimcpstInitialized state; otherwise the call raises an exception.

Example

MCP.OnMCPListTools := procedure(Sender: TObject;
  const aRequest: TsgcAI_MCP_Request_ToolsList;
  const aResponse: TsgcAI_MCP_Response_ToolsList)
begin
  MemoLog.Lines.Text := aResponse.Write;
end;
MCP.ListTools;

Back to Methods