Method: projects.locations.collections.dataConnector.invokeConnectorMcp

撥打電話給 MCP 連接器。

HTTP 要求

POST https://discoveryengine.googleapis.com/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}:invokeConnectorMcp

這個網址使用 gRPC 轉碼語法。

路徑參數

參數
name

string

這是必要旗標,DataConnector 資源。

用於發出 MCP 呼叫的資料連接器。

要求主體

要求主體包含下列結構的資料:

JSON 表示法
{
  "method": string,
  "params": {
    object
  },
  "engine": string,
  "toolSpecVersion": string
}
欄位
method

string

這是必要旗標,要叫用的方法 (例如「tools/list」、「tools/call」、「resources/read」、「prompts/get」等)。

params

object (Struct format)

選用。方法的任意結構化參數。

使用 google.protobuf.Struct 可讓酬載結構定義保持彈性,符合 JSON-RPC 的任意形式 params 欄位。

engine

string

選用。引擎資源名稱 (例如「projects/{project}/locations/{location}/collections/{collection}/engines/{engine}」)。叫用發出 Discovery Search Service 要求的工具登錄工具時,做為搜尋引擎 ID。

toolSpecVersion

string

選用。用來解析連結器工具介面的工具規格版本。這對應於連接器的 BAP 工具規格檔案名稱 (例如「v2」、「v5.2」)。如果不設定,伺服器會使用連接器的預設 (最新) 工具規格。適用於所有方法 (例如「tools/list」和「tools/call」)。

回應主體

回應訊息,傳回 MCP 連接器調用結果。其中包含成功結果的酬載或錯誤詳細資料。

如果成功,回應主體會含有以下結構的資料:

JSON 表示法
{

  // Union field payload can be only one of the following:
  "result": value,
  "error": {
    object (McpError)
  }
  // End of list of possible types for union field payload.
}
欄位
聯集欄位 payload。請設定 resulterror 其中之一。payload 只能是下列其中一項:
result

value (Value format)

成功結果 - 任意結構化資料。

error

object (McpError)

通話失敗時的錯誤詳細資料。

授權範圍

需要下列其中一種 OAuth 範圍:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/discoveryengine.assist.readwrite
  • https://www.googleapis.com/auth/discoveryengine.readwrite
  • https://www.googleapis.com/auth/discoveryengine.serving.readwrite

詳情請參閱Authentication Overview

IAM 權限

需要 name 資源的下列 IAM 權限:

  • discoveryengine.dataConnectors.executeAction

詳情請參閱 IAM 說明文件

McpError

如果 MCP 呼叫失敗,McpError 會代表錯誤詳細資料。這個結構遵循 JSON-RPC 2.0 錯誤物件形狀。

JSON 表示法
{
  "code": integer,
  "message": string,
  "data": value
}
欄位
code

integer

數字錯誤代碼。

message

string

使用者可理解的簡短錯誤說明。

data

value (Value format)

選用的結構化資料,提供額外的錯誤情境。