MCP Tools Reference: ces.googleapis.com

工具:update_toolset

更新指定的工具集。請務必在輸入內容中傳遞更新遮罩。

下列程式碼範例說明如何使用 curl 呼叫 update_toolset MCP 工具。

Curl 要求
curl --location 'https://ces.googleapis.com/mcp' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
  "method": "tools/call",
  "params": {
    "name": "update_toolset",
    "arguments": {
      // provide these details according to the tool's MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'

輸入內容的結構定義

AgentService.UpdateToolset 的要求訊息。

UpdateToolsetRequest

JSON 表示法
{
  "toolset": {
    object (Toolset)
  },
  "updateMask": string
}
欄位
toolset

object (Toolset)

這是必要旗標,要更新的工具集。

updateMask

string (FieldMask format)

選用。欄位遮罩用於控管要更新的欄位。如果沒有遮罩,系統會更新所有欄位。

這是以半形逗號分隔的完整欄位名稱清單,範例:"user.displayName,photo"

工具集

JSON 表示法
{
  "name": string,
  "displayName": string,
  "description": string,
  "timeout": string,
  "createTime": string,
  "updateTime": string,
  "etag": string,
  "executionType": enum (ExecutionType),
  "toolFakeConfig": {
    object (ToolFakeConfig)
  },

  // Union field toolset_type can be only one of the following:
  "mcpToolset": {
    object (McpToolset)
  },
  "openApiToolset": {
    object (OpenApiToolset)
  },
  "connectorToolset": {
    object (ConnectorToolset)
  }
  // End of list of possible types for union field toolset_type.
}
欄位
name

string

ID。工具組的專屬 ID。格式:projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}

displayName

string

選用。工具集的顯示名稱。不得重複用於同一應用程式。

description

string

選用。工具組的說明。

timeout

string (Duration format)

選用。工具集執行作業的逾時時間。如未設定,SYNCHRONOUS 工具集的預設逾時時間為 30 秒,ASYNCHRONOUS 工具集則為 60 秒。

時間長度以秒為單位,最多可有 9 個小數位數,並應以「s」結尾,例如:"3.5s"

createTime

string (Timestamp format)

僅供輸出。建立工具集的時間戳記。

使用 RFC 3339,產生的輸出內容一律會經過 Z 正規化,並使用 0、3、6 或 9 個小數位數,也接受「Z」以外的偏移量。範例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

updateTime

string (Timestamp format)

僅供輸出。上次更新工具集的時間戳記。

使用 RFC 3339,產生的輸出內容一律會經過 Z 正規化,並使用 0、3、6 或 9 個小數位數,也接受「Z」以外的偏移量。範例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

etag

string

ETag 用於確保物件在讀取-修改-寫入作業期間未變更。如果 etag 為空,更新作業會覆寫任何並行變更。

executionType

enum (ExecutionType)

選用。工具集中工具的執行類型。

toolFakeConfig

object (ToolFakeConfig)

選用。在模擬模式中設定工具行為。

聯集欄位 toolset_type。工具組類型。toolset_type 只能是下列其中一個設定:
mcpToolset

object (McpToolset)

選用。工具集,內含 MCP 伺服器提供的工具清單。

openApiToolset

object (OpenApiToolset)

選用。工具集,內含 OpenAPI 結構定義所定義的工具清單。

connectorToolset

object (ConnectorToolset)

選用。這組工具可從 Integration Connectors 連線產生工具。

McpToolset

JSON 表示法
{
  "serverAddress": string,
  "apiAuthentication": {
    object (ApiAuthentication)
  },
  "serviceDirectoryConfig": {
    object (ServiceDirectoryConfig)
  },
  "tlsConfig": {
    object (TlsConfig)
  },
  "customHeaders": {
    string: string,
    ...
  },
  "toolOverrides": [
    {
      object (McpToolOverride)
    }
  ]
}
欄位
serverAddress

string

這是必要旗標,MCP 伺服器的位址,例如「https://example.com/mcp/」。如果伺服器是使用 MCP SDK 建構,網址應加上「/mcp/」後置字串。僅支援以可串流 HTTP 傳輸為基礎的伺服器。詳情請參閱 https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http

apiAuthentication

object (ApiAuthentication)

選用。存取工具及針對 MCP 伺服器執行工具時,必須提供驗證資訊。如果是持有人權杖驗證,權杖僅適用於工具執行,不適用於列出工具。因此工具必須可供列出,不必經過驗證。

serviceDirectoryConfig

object (ServiceDirectoryConfig)

選用。VPC-SC 的 Service Directory 設定,用於解析範圍內的服務名稱。

tlsConfig

object (TlsConfig)

選用。傳輸層安全標準 (TLS) 設定。包含用戶端應信任的自訂伺服器憑證。

customHeaders

map (key: string, value: string)

選用。要在要求中傳送至 MCP 伺服器的自訂標頭。值必須採用 $context.variables.<name_of_variable> 格式,且可在工作階段變數中設定。詳情請參閱 https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool/open-api#openapi-injection

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

toolOverrides[]

object (McpToolOverride)

選用。這個工具集內個別工具的覆寫設定。這項功能可覆寫特定詳細資料 (例如說明、名稱),或固定工具的狀態,避免工具完全動態。

ApiAuthentication

JSON 表示法
{

  // Union field auth_config can be only one of the following:
  "apiKeyConfig": {
    object (ApiKeyConfig)
  },
  "oauthConfig": {
    object (OAuthConfig)
  },
  "serviceAgentIdTokenAuthConfig": {
    object (ServiceAgentIdTokenAuthConfig)
  },
  "serviceAccountAuthConfig": {
    object (ServiceAccountAuthConfig)
  },
  "bearerTokenConfig": {
    object (BearerTokenConfig)
  }
  // End of list of possible types for union field auth_config.
}
欄位
聯集欄位 auth_config。驗證設定。auth_config 只能是下列其中一個設定:
apiKeyConfig

object (ApiKeyConfig)

選用。API 金鑰驗證的設定。

oauthConfig

object (OAuthConfig)

選用。OAuth 設定。

serviceAgentIdTokenAuthConfig

object (ServiceAgentIdTokenAuthConfig)

選用。從 CES 服務代理程式產生的 ID 權杖驗證設定。

serviceAccountAuthConfig

object (ServiceAccountAuthConfig)

選用。服務帳戶驗證的設定。

bearerTokenConfig

object (BearerTokenConfig)

選用。不記名權杖驗證的設定。

ApiKeyConfig

JSON 表示法
{
  "keyName": string,
  "apiKeySecretVersion": string,
  "requestLocation": enum (RequestLocation)
}
欄位
keyName

string

這是必要旗標,API 金鑰的參數名稱或標頭名稱。例如:如果 API 要求是「https://example.com/act?X-Api-Key=」,則「X-Api-Key」就是參數名稱。

apiKeySecretVersion

string

這是必要旗標,儲存 API 金鑰的 SecretManager 密鑰版本資源名稱。格式:projects/{project}/secrets/{secret}/versions/{version}

注意:您應將 roles/secretmanager.secretAccessor 角色授予 CES 服務代理人 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com

requestLocation

enum (RequestLocation)

這是必要旗標,要求中的金鑰位置。

OAuthConfig

JSON 表示法
{
  "oauthGrantType": enum (OauthGrantType),
  "clientId": string,
  "clientSecretVersion": string,
  "tokenEndpoint": string,
  "scopes": [
    string
  ]
}
欄位
oauthGrantType

enum (OauthGrantType)

這是必要旗標,OAuth 授權類型。

clientId

string

這是必要旗標,OAuth 供應商提供的用戶端 ID。

clientSecretVersion

string

這是必要旗標,儲存用戶端密鑰的 SecretManager 密鑰版本資源名稱。格式:projects/{project}/secrets/{secret}/versions/{version}

注意:您應將 roles/secretmanager.secretAccessor 角色授予 CES 服務代理人 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com

tokenEndpoint

string

這是必要旗標,OAuth 供應商中的權杖端點,用於交換存取權杖。

scopes[]

string

選用。要授予的 OAuth 範圍。

ServiceAccountAuthConfig

JSON 表示法
{
  "serviceAccount": string,
  "scopes": [
    string
  ]
}
欄位
serviceAccount

string

這是必要旗標,用於驗證的服務帳戶電子郵件地址。CES 會使用這個服務帳戶交換存取權杖,然後在要求的 Authorization 標頭中傳送存取權杖。

服務帳戶必須獲派 roles/iam.serviceAccountTokenCreator 角色,才能授予 CES 服務代理 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com

scopes[]

string

選用。要授予的 OAuth 範圍。如未指定,則會使用預設範圍 https://www.googleapis.com/auth/cloud-platform

BearerTokenConfig

JSON 表示法
{
  "token": string
}
欄位
token

string

這是必要旗標,不記名權杖。格式必須為 $context.variables.<name_of_variable>

ServiceDirectoryConfig

JSON 表示法
{
  "service": string
}
欄位
service

string

這是必要旗標,Service Directory 服務的名稱。格式:projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}。服務目錄的位置必須與應用程式的位置相同。

TlsConfig

JSON 表示法
{
  "caCerts": [
    {
      object (CaCert)
    }
  ]
}
欄位
caCerts[]

object (CaCert)

這是必要旗標,指定允許用於 HTTPS 驗證的自訂 CA 憑證清單。

CaCert

JSON 表示法
{
  "displayName": string,
  "cert": string
}
欄位
displayName

string

這是必要旗標,允許使用的自訂 CA 憑證名稱。這可用於消除自訂 CA 憑證的歧義。

cert

string (bytes format)

這是必要旗標,用於 HTTPS 驗證的允許自訂 CA 憑證 (DER 格式)。這會覆寫預設的 SSL 信任存放區。如為空白或未指定,CES 會使用 Google 的預設信任存放區驗證憑證。注意:請確認 HTTPS 伺服器憑證是以「主體替代名稱」簽署。舉例來說,您可以使用下列指令自行簽署憑證:

   openssl x509 -req -days 200 -in example.com.csr \
     -signkey example.com.key \
     -out example.com.crt \
     -extfile <(printf "\nsubjectAltName='DNS:www.example.com'")

Base64 編碼字串。

CustomHeadersEntry

JSON 表示法
{
  "key": string,
  "value": string
}
欄位
key

string

value

string

McpToolOverride

JSON 表示法
{
  "tool": string,
  "nameOverride": string,
  "descriptionOverride": string,
  "snapshot": {
    object (McpToolDefinition)
  }
}
欄位
tool

string

這是必要旗標,工具的原始名稱,由 MCP 伺服器發出。

nameOverride

string

選用。如果存在,這個工具會在代理程式中使用這個名稱,而非原始名稱。如果 MCP 伺服器提供的工具名稱不佳,這項屬性主要會做為別名使用。

descriptionOverride

string

選用。如果有的話,這項工具會使用這項說明,而非伺服器提供的原始說明。

snapshot

object (McpToolDefinition)

僅供輸出。如果這個工具存在,就會「固定」使用快照值做為備援,以防伺服器暫時無法使用,或沒有覆寫值。

McpToolDefinition

JSON 表示法
{
  "description": string,
  "inputSchema": {
    object (Schema)
  },
  "outputSchema": {
    object (Schema)
  }
}
欄位
description

string

僅供輸出。MCP 工具的說明。這項設定可由 McpToolOverride 中的 description_override 覆寫。

inputSchema

object (Schema)

僅供輸出。MCP 工具輸入引數的結構定義。

outputSchema

object (Schema)

僅供輸出。MCP 工具輸出引數的結構定義。

結構定義

JSON 表示法
{
  "type": enum (Type),
  "properties": {
    string: {
      object (Schema)
    },
    ...
  },
  "required": [
    string
  ],
  "description": string,
  "items": {
    object (Schema)
  },
  "nullable": boolean,
  "uniqueItems": boolean,
  "prefixItems": [
    {
      object (Schema)
    }
  ],
  "additionalProperties": {
    object (Schema)
  },
  "anyOf": [
    {
      object (Schema)
    }
  ],
  "enum": [
    string
  ],
  "default": value,
  "ref": string,
  "defs": {
    string: {
      object (Schema)
    },
    ...
  },
  "title": string,
  "minItems": string,
  "maxItems": string,

  // Union field _minimum can be only one of the following:
  "minimum": number
  // End of list of possible types for union field _minimum.

  // Union field _maximum can be only one of the following:
  "maximum": number
  // End of list of possible types for union field _maximum.
}
欄位
type

enum (Type)

這是必要旗標,資料類型。

properties

map (key: string, value: object (Schema))

選用。Type.OBJECT 的屬性。

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

required[]

string

選用。Type.OBJECT 的必要屬性。

description

string

選用。資料說明。

items

object (Schema)

選用。Type.ARRAY 元素的結構定義。

nullable

boolean

選用。指出值是否可能為空值。

uniqueItems

boolean

選用。指出陣列中的項目不得重複。僅適用於 TYPE.ARRAY。

prefixItems[]

object (Schema)

選用。Type.ARRAY 初始元素的結構定義。

additionalProperties

object (Schema)

選用。可以是布林值或物件,用來控制其他屬性的存在。

anyOf[]

object (Schema)

選用。系統應根據清單中的任何 (一或多個) 子結構定義驗證值。

enum[]

string

選用。可能的值為列舉格式的原始類型元素。範例:1. 我們可以將方向定義為:{type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. 我們可以將公寓號碼定義為:{type:INTEGER, format:enum, enum:["101", "201", "301"]}

default

value (Value format)

選用。資料的預設值。

ref

string

選用。允許在結構定義節點之間建立間接參照。此值應為根 defs 子項的有效參照。

舉例來說,下列結構定義會定義對名為「Pet」的結構節點的參照:

type: object
properties:
  pet:
    ref: #/defs/Pet
defs:
  Pet:
    type: object
    properties:
      name:
        type: string

「pet」屬性的值是參照名為「Pet」的結構定義節點。詳情請參閱 https://json-schema.org/understanding-json-schema/structuring

defs

map (key: string, value: object (Schema))

選用。供 ref 使用的定義對應表。只能在結構定義的根層級使用。

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

title

string

選用。結構定義的標題。

minItems

string (int64 format)

選用。Type.ARRAY 的元素數量下限。

maxItems

string (int64 format)

選用。Type.ARRAY 的元素數量上限。

聯集欄位 _minimum

_minimum 只能是下列其中一項:

minimum

number

選用。Type.INTEGER 和 Type.NUMBER 的最小值。

聯集欄位 _maximum

_maximum 只能是下列其中一項:

maximum

number

選用。Type.INTEGER 和 Type.NUMBER 的最大值。

PropertiesEntry

JSON 表示法
{
  "key": string,
  "value": {
    object (Schema)
  }
}
欄位
key

string

value

object (Schema)

JSON 表示法
{

  // Union field kind can be only one of the following:
  "nullValue": null,
  "numberValue": number,
  "stringValue": string,
  "boolValue": boolean,
  "structValue": {
    object
  },
  "listValue": array
  // End of list of possible types for union field kind.
}
欄位
聯集欄位 kind。值的類型。kind 只能是下列其中一個設定:
nullValue

null

代表 JSON null

numberValue

number

代表 JSON 數字。不得為 NaNInfinity-Infinity,因為 JSON 不支援這些字元。此外,由於 JSON 格式一般不支援數字類型中的大型 Int64 值,因此也無法表示這類值。

stringValue

string

代表 JSON 字串。

boolValue

boolean

代表 JSON 布林值 (JSON 中的 truefalse 常值)。

structValue

object (Struct format)

代表 JSON 物件。

listValue

array (ListValue format)

代表 JSON 陣列。

結構

JSON 表示法
{
  "fields": {
    string: value,
    ...
  }
}
欄位
fields

map (key: string, value: value (Value format))

動態型別值的無序對應。

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

FieldsEntry

JSON 表示法
{
  "key": string,
  "value": value
}
欄位
key

string

value

value (Value format)

ListValue

JSON 表示法
{
  "values": [
    value
  ]
}
欄位
values[]

value (Value format)

動態型別值的重複欄位。

DefsEntry

JSON 表示法
{
  "key": string,
  "value": {
    object (Schema)
  }
}
欄位
key

string

value

object (Schema)

OpenApiToolset

JSON 表示法
{
  "openApiSchema": string,
  "apiAuthentication": {
    object (ApiAuthentication)
  },
  "tlsConfig": {
    object (TlsConfig)
  },
  "serviceDirectoryConfig": {
    object (ServiceDirectoryConfig)
  },
  "ignoreUnknownFields": boolean,
  "url": string
}
欄位
openApiSchema

string

這是必要旗標,工具集的 OpenAPI 結構定義。

apiAuthentication

object (ApiAuthentication)

選用。API 要求的驗證資訊。

tlsConfig

object (TlsConfig)

選用。傳輸層安全標準 (TLS) 設定。包含自訂伺服器憑證

serviceDirectoryConfig

object (ServiceDirectoryConfig)

選用。Service Directory 設定。

ignoreUnknownFields

boolean

選用。如果設為 true,對於 OpenAPI 結構定義中定義的所有作業,代理程式都會忽略 API 回應中的不明欄位。

url

string

選用。開放式 API 結構定義的伺服器網址。如果結構定義包含伺服器網址,則只有在匯出程序期間的環境依附元件中,才會設定這個欄位。在匯入過程中,如果環境依附元件中存在這個網址,且結構定義含有 $env_var 預留位置,系統就會取代結構定義中的預留位置。

ConnectorToolset

JSON 表示法
{
  "connection": string,
  "authConfig": {
    object (EndUserAuthConfig)
  },
  "connectorActions": [
    {
      object (Action)
    }
  ]
}
欄位
connection

string

這是必要旗標,所參照 Integration Connectors 連線的完整資源名稱。格式:projects/{project}/locations/{location}/connections/{connection}

authConfig

object (EndUserAuthConfig)

選用。設定 Integration Connectors 中驗證的處理方式。根據預設,管理員驗證會傳遞至 Integration Connectors API 要求。您可以覆寫這項設定,改用其他使用者驗證設定。注意:連線必須啟用驗證覆寫功能,才能在此指定 EUC 設定,否則工具集建立作業會失敗。詳情請參閱:https://cloud.google.com/application-integration/docs/configure-connectors-task#configure-authentication-override

connectorActions[]

object (Action)

這是必要旗標,要產生工具的連接器動作/實體作業清單。

EndUserAuthConfig

JSON 表示法
{

  // Union field auth_config can be only one of the following:
  "oauth2AuthCodeConfig": {
    object (Oauth2AuthCodeConfig)
  },
  "oauth2JwtBearerConfig": {
    object (Oauth2JwtBearerConfig)
  }
  // End of list of possible types for union field auth_config.
}
欄位
聯集欄位 auth_config。驗證設定。auth_config 只能是下列其中一個設定:
oauth2AuthCodeConfig

object (Oauth2AuthCodeConfig)

Oauth 2.0 授權碼驗證。

oauth2JwtBearerConfig

object (Oauth2JwtBearerConfig)

JWT 設定檔 OAuth 2.0 授權授予驗證。

Oauth2AuthCodeConfig

JSON 表示法
{
  "oauthToken": string
}
欄位
oauthToken

string

這是必要旗標,要傳遞的 OAuth 權杖參數名稱。格式必須為 $context.variables.<name_of_variable>

Oauth2JwtBearerConfig

JSON 表示法
{
  "issuer": string,
  "subject": string,
  "clientKey": string
}
欄位
issuer

string

這是必要旗標,要傳遞的發卡機構參數名稱。格式必須為 $context.variables.<name_of_variable>

subject

string

這是必要旗標,要傳送的主體參數名稱。格式必須為 $context.variables.<name_of_variable>

clientKey

string

這是必要旗標,要傳遞的用戶端參數名稱。格式必須為 $context.variables.<name_of_variable>

動作

JSON 表示法
{
  "inputFields": [
    string
  ],
  "outputFields": [
    string
  ],

  // Union field action_spec can be only one of the following:
  "connectionActionId": string,
  "entityOperation": {
    object (EntityOperation)
  }
  // End of list of possible types for union field action_spec.
}
欄位
inputFields[]

string

選用。做為作業輸入內容的實體欄位。如未指定任何欄位,系統會使用實體的所有欄位。

outputFields[]

string

選用。要從作業傳回的實體欄位。如未指定任何欄位,系統會傳回 Entity 的所有欄位。

聯集欄位 action_spec。工具要使用的動作設定規格。action_spec 只能是下列其中一個設定:
connectionActionId

string

工具要使用的「連線」動作 ID。

entityOperation

object (EntityOperation)

工具要使用的實體作業設定。

EntityOperation

JSON 表示法
{
  "entityId": string,
  "operation": enum (OperationType)
}
欄位
entityId

string

這是必要旗標,實體的 ID。

operation

enum (OperationType)

這是必要旗標,要在實體上執行的作業。

時間長度

JSON 表示法
{
  "seconds": string,
  "nanos": integer
}
欄位
seconds

string (int64 format)

時間範圍的秒數 (可為負值)。必須介於 -315,576,000,000 至 +315,576,000,000 之間 (含頭尾)。注意:這些界限是根據以下公式計算得出:60 秒/分 * 60 分/時 * 24 時/天 * 365.25 天/年 * 10000 年

nanos

integer

時間跨度以奈秒為單位的正負秒數。如果時間長度不到一秒,系統會以 0 seconds 欄位和正數或負數 nanos 欄位表示。如果時間長度為一秒以上,nanos 欄位的非零值必須與 seconds 欄位相同。值必須介於 -999,999,999 到 +999,999,999 之間 (含)。

時間戳記

JSON 表示法
{
  "seconds": string,
  "nanos": integer
}
欄位
seconds

string (int64 format)

代表自 Unix 紀元 1970-01-01T00:00:00Z 起算的世界標準時間秒數。必須介於 -62135596800 和 253402300799 之間 (含),對應至 0001-01-01T00:00:00Z 至 9999-12-31T23:59:59Z。

nanos

integer

以奈秒為單位的非負秒數小數。這個欄位是時間長度的奈秒部分,並非秒數的替代值。如果秒數值為負數,且包含小數,奈秒值仍須為非負數,且會往前計算時間。必須介於 0 至 999,999,999 之間 (含)。

ToolFakeConfig

JSON 表示法
{
  "enableFakeMode": boolean,

  // Union field tool_response can be only one of the following:
  "codeBlock": {
    object (CodeBlock)
  }
  // End of list of possible types for union field tool_response.
}
欄位
enableFakeMode

boolean

選用。工具是否使用模擬模式。

聯集欄位 tool_response。回應可以是靜態,也可以由 Python 函式提供。tool_response 只能是下列其中一個設定:
codeBlock

object (CodeBlock)

選用。要執行的程式碼區塊,而非實際的工具呼叫。

CodeBlock

JSON 表示法
{
  "pythonCode": string
}
欄位
pythonCode

string

這是必要旗標,以工具模擬模式叫用的 Python 程式碼。預期的 Python 函式簽章 - 如要擷取所有工具呼叫: def fake_tool_call(tool: Tool, input: dict[str, Any], callback_context: CallbackContext) -> Optional[dict[str, Any]]: 如要擷取特定工具呼叫: def fake_{tool_id}(tool: Tool, input: dict[str, Any], callback_context: CallbackContext) -> Optional[dict[str, Any]]: 如果函式傳回 None,系統會改為叫用實際工具。

FieldMask

JSON 表示法
{
  "paths": [
    string
  ]
}
欄位
paths[]

string

一組欄位遮罩路徑。

RequestLocation

要求中 API 金鑰的位置。

列舉
REQUEST_LOCATION_UNSPECIFIED 不明。請勿使用此值。
HEADER 代表 HTTP 標頭中的金鑰。
QUERY_STRING 代表查詢字串中的鍵。

OauthGrantType

OAuth 授權類型。系統僅支援用戶端憑證授權

列舉
OAUTH_GRANT_TYPE_UNSPECIFIED 不明。預設為 CLIENT_CREDENTIAL。
CLIENT_CREDENTIAL 代表用戶端憑證流程

類型

OpenAPI 資料型別。

列舉
TYPE_UNSPECIFIED 未指定類型。
STRING 字串類型。
INTEGER 整數類型。
NUMBER 電話號碼類型。
BOOLEAN 布林類型。
OBJECT 物件類型。
ARRAY 陣列類型。

NullValue

代表 JSON null

NullValue 是哨兵,使用只有一個值的列舉,代表 Value 型別聯集的空值。

如果 NullValue 類型的欄位值不是 0,系統就會視為無效。大多數 ProtoJSON 序列化程式都會發出 Value,並將 null_value 設為 JSON null (不論整數值為何),因此會來回傳輸至 0 值。

列舉
NULL_VALUE 空值。

OperationType

要在實體上執行的作業。

列舉
OPERATION_TYPE_UNSPECIFIED 未指定作業類型。無效,ConnectorTool 建立/更新作業將失敗。
LIST 列出作業。
GET 取得作業。
CREATE 建立作業。
UPDATE 更新作業。
DELETE 刪除作業。

ExecutionType

工具或工具組的執行類型。

列舉
EXECUTION_TYPE_UNSPECIFIED 未指定執行類型。如未指定,預設值為 SYNCHRONOUS
SYNCHRONOUS 工具會同步執行。工作階段會遭到封鎖,直到工具傳回為止。
ASYNCHRONOUS 這項工具會以非同步方式執行。工具執行期間,工作階段會繼續進行。

輸出內容的結構定義

工具集代表一組可供代理使用的動態管理工具。

工具集

JSON 表示法
{
  "name": string,
  "displayName": string,
  "description": string,
  "timeout": string,
  "createTime": string,
  "updateTime": string,
  "etag": string,
  "executionType": enum (ExecutionType),
  "toolFakeConfig": {
    object (ToolFakeConfig)
  },

  // Union field toolset_type can be only one of the following:
  "mcpToolset": {
    object (McpToolset)
  },
  "openApiToolset": {
    object (OpenApiToolset)
  },
  "connectorToolset": {
    object (ConnectorToolset)
  }
  // End of list of possible types for union field toolset_type.
}
欄位
name

string

ID。工具組的專屬 ID。格式:projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}

displayName

string

選用。工具集的顯示名稱。不得重複用於同一應用程式。

description

string

選用。工具組的說明。

timeout

string (Duration format)

選用。工具集執行作業的逾時時間。如未設定,SYNCHRONOUS 工具集的預設逾時時間為 30 秒,ASYNCHRONOUS 工具集則為 60 秒。

時間長度以秒為單位,最多可有 9 個小數位數,並應以「s」結尾,例如:"3.5s"

createTime

string (Timestamp format)

僅供輸出。建立工具集的時間戳記。

使用 RFC 3339,產生的輸出內容一律會經過 Z 正規化,並使用 0、3、6 或 9 個小數位數,也接受「Z」以外的偏移量。範例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

updateTime

string (Timestamp format)

僅供輸出。上次更新工具集的時間戳記。

使用 RFC 3339,產生的輸出內容一律會經過 Z 正規化,並使用 0、3、6 或 9 個小數位數,也接受「Z」以外的偏移量。範例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

etag

string

ETag 用於確保物件在讀取-修改-寫入作業期間未變更。如果 etag 為空,更新作業會覆寫任何並行變更。

executionType

enum (ExecutionType)

選用。工具集中工具的執行類型。

toolFakeConfig

object (ToolFakeConfig)

選用。在模擬模式中設定工具行為。

聯集欄位 toolset_type。工具組類型。toolset_type 只能是下列其中一個設定:
mcpToolset

object (McpToolset)

選用。工具集,內含 MCP 伺服器提供的工具清單。

openApiToolset

object (OpenApiToolset)

選用。工具集,內含 OpenAPI 結構定義所定義的工具清單。

connectorToolset

object (ConnectorToolset)

選用。這組工具可從 Integration Connectors 連線產生工具。

McpToolset

JSON 表示法
{
  "serverAddress": string,
  "apiAuthentication": {
    object (ApiAuthentication)
  },
  "serviceDirectoryConfig": {
    object (ServiceDirectoryConfig)
  },
  "tlsConfig": {
    object (TlsConfig)
  },
  "customHeaders": {
    string: string,
    ...
  },
  "toolOverrides": [
    {
      object (McpToolOverride)
    }
  ]
}
欄位
serverAddress

string

這是必要旗標,MCP 伺服器的位址,例如「https://example.com/mcp/」。如果伺服器是使用 MCP SDK 建構,網址應加上「/mcp/」後置字串。僅支援以可串流 HTTP 傳輸為基礎的伺服器。詳情請參閱 https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http

apiAuthentication

object (ApiAuthentication)

選用。存取工具及針對 MCP 伺服器執行工具時,必須提供驗證資訊。如果是持有人權杖驗證,權杖僅適用於工具執行,不適用於列出工具。因此工具必須可供列出,不必經過驗證。

serviceDirectoryConfig

object (ServiceDirectoryConfig)

選用。VPC-SC 的 Service Directory 設定,用於解析範圍內的服務名稱。

tlsConfig

object (TlsConfig)

選用。傳輸層安全標準 (TLS) 設定。包含用戶端應信任的自訂伺服器憑證。

customHeaders

map (key: string, value: string)

選用。要在要求中傳送至 MCP 伺服器的自訂標頭。值必須採用 $context.variables.<name_of_variable> 格式,且可在工作階段變數中設定。詳情請參閱 https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool/open-api#openapi-injection

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

toolOverrides[]

object (McpToolOverride)

選用。這個工具集內個別工具的覆寫設定。這項功能可覆寫特定詳細資料 (例如說明、名稱),或固定工具的狀態,避免工具完全動態。

ApiAuthentication

JSON 表示法
{

  // Union field auth_config can be only one of the following:
  "apiKeyConfig": {
    object (ApiKeyConfig)
  },
  "oauthConfig": {
    object (OAuthConfig)
  },
  "serviceAgentIdTokenAuthConfig": {
    object (ServiceAgentIdTokenAuthConfig)
  },
  "serviceAccountAuthConfig": {
    object (ServiceAccountAuthConfig)
  },
  "bearerTokenConfig": {
    object (BearerTokenConfig)
  }
  // End of list of possible types for union field auth_config.
}
欄位
聯集欄位 auth_config。驗證設定。auth_config 只能是下列其中一個設定:
apiKeyConfig

object (ApiKeyConfig)

選用。API 金鑰驗證的設定。

oauthConfig

object (OAuthConfig)

選用。OAuth 設定。

serviceAgentIdTokenAuthConfig

object (ServiceAgentIdTokenAuthConfig)

選用。從 CES 服務代理程式產生的 ID 權杖驗證設定。

serviceAccountAuthConfig

object (ServiceAccountAuthConfig)

選用。服務帳戶驗證的設定。

bearerTokenConfig

object (BearerTokenConfig)

選用。不記名權杖驗證的設定。

ApiKeyConfig

JSON 表示法
{
  "keyName": string,
  "apiKeySecretVersion": string,
  "requestLocation": enum (RequestLocation)
}
欄位
keyName

string

這是必要旗標,API 金鑰的參數名稱或標頭名稱。例如:如果 API 要求是「https://example.com/act?X-Api-Key=」,則「X-Api-Key」就是參數名稱。

apiKeySecretVersion

string

這是必要旗標,儲存 API 金鑰的 SecretManager 密鑰版本資源名稱。格式:projects/{project}/secrets/{secret}/versions/{version}

注意:您應將 roles/secretmanager.secretAccessor 角色授予 CES 服務代理人 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com

requestLocation

enum (RequestLocation)

這是必要旗標,要求中的金鑰位置。

OAuthConfig

JSON 表示法
{
  "oauthGrantType": enum (OauthGrantType),
  "clientId": string,
  "clientSecretVersion": string,
  "tokenEndpoint": string,
  "scopes": [
    string
  ]
}
欄位
oauthGrantType

enum (OauthGrantType)

這是必要旗標,OAuth 授權類型。

clientId

string

這是必要旗標,OAuth 供應商提供的用戶端 ID。

clientSecretVersion

string

這是必要旗標,儲存用戶端密鑰的 SecretManager 密鑰版本資源名稱。格式:projects/{project}/secrets/{secret}/versions/{version}

注意:您應將 roles/secretmanager.secretAccessor 角色授予 CES 服務代理人 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com

tokenEndpoint

string

這是必要旗標,OAuth 供應商中的權杖端點,用於交換存取權杖。

scopes[]

string

選用。要授予的 OAuth 範圍。

ServiceAccountAuthConfig

JSON 表示法
{
  "serviceAccount": string,
  "scopes": [
    string
  ]
}
欄位
serviceAccount

string

這是必要旗標,用於驗證的服務帳戶電子郵件地址。CES 會使用這個服務帳戶交換存取權杖,然後在要求的 Authorization 標頭中傳送存取權杖。

服務帳戶必須獲派 roles/iam.serviceAccountTokenCreator 角色,才能授予 CES 服務代理 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com

scopes[]

string

選用。要授予的 OAuth 範圍。如未指定,則會使用預設範圍 https://www.googleapis.com/auth/cloud-platform

BearerTokenConfig

JSON 表示法
{
  "token": string
}
欄位
token

string

這是必要旗標,不記名權杖。格式必須為 $context.variables.<name_of_variable>

ServiceDirectoryConfig

JSON 表示法
{
  "service": string
}
欄位
service

string

這是必要旗標,Service Directory 服務的名稱。格式:projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}。服務目錄的位置必須與應用程式的位置相同。

TlsConfig

JSON 表示法
{
  "caCerts": [
    {
      object (CaCert)
    }
  ]
}
欄位
caCerts[]

object (CaCert)

這是必要旗標,指定允許用於 HTTPS 驗證的自訂 CA 憑證清單。

CaCert

JSON 表示法
{
  "displayName": string,
  "cert": string
}
欄位
displayName

string

這是必要旗標,允許使用的自訂 CA 憑證名稱。這可用於消除自訂 CA 憑證的歧義。

cert

string (bytes format)

這是必要旗標,用於 HTTPS 驗證的允許自訂 CA 憑證 (DER 格式)。這會覆寫預設的 SSL 信任存放區。如為空白或未指定,CES 會使用 Google 的預設信任存放區驗證憑證。注意:請確認 HTTPS 伺服器憑證是以「主體替代名稱」簽署。舉例來說,您可以使用下列指令自行簽署憑證:

   openssl x509 -req -days 200 -in example.com.csr \
     -signkey example.com.key \
     -out example.com.crt \
     -extfile <(printf "\nsubjectAltName='DNS:www.example.com'")

Base64 編碼字串。

CustomHeadersEntry

JSON 表示法
{
  "key": string,
  "value": string
}
欄位
key

string

value

string

McpToolOverride

JSON 表示法
{
  "tool": string,
  "nameOverride": string,
  "descriptionOverride": string,
  "snapshot": {
    object (McpToolDefinition)
  }
}
欄位
tool

string

這是必要旗標,工具的原始名稱,由 MCP 伺服器發出。

nameOverride

string

選用。如果存在,這個工具會在代理程式中使用這個名稱,而非原始名稱。如果 MCP 伺服器提供的工具名稱不佳,這項屬性主要會做為別名使用。

descriptionOverride

string

選用。如果有的話,這項工具會使用這項說明,而非伺服器提供的原始說明。

snapshot

object (McpToolDefinition)

僅供輸出。如果這個工具存在,就會「固定」使用快照值做為備援,以防伺服器暫時無法使用,或沒有覆寫值。

McpToolDefinition

JSON 表示法
{
  "description": string,
  "inputSchema": {
    object (Schema)
  },
  "outputSchema": {
    object (Schema)
  }
}
欄位
description

string

僅供輸出。MCP 工具的說明。這項設定可由 McpToolOverride 中的 description_override 覆寫。

inputSchema

object (Schema)

僅供輸出。MCP 工具輸入引數的結構定義。

outputSchema

object (Schema)

僅供輸出。MCP 工具輸出引數的結構定義。

結構定義

JSON 表示法
{
  "type": enum (Type),
  "properties": {
    string: {
      object (Schema)
    },
    ...
  },
  "required": [
    string
  ],
  "description": string,
  "items": {
    object (Schema)
  },
  "nullable": boolean,
  "uniqueItems": boolean,
  "prefixItems": [
    {
      object (Schema)
    }
  ],
  "additionalProperties": {
    object (Schema)
  },
  "anyOf": [
    {
      object (Schema)
    }
  ],
  "enum": [
    string
  ],
  "default": value,
  "ref": string,
  "defs": {
    string: {
      object (Schema)
    },
    ...
  },
  "title": string,
  "minItems": string,
  "maxItems": string,

  // Union field _minimum can be only one of the following:
  "minimum": number
  // End of list of possible types for union field _minimum.

  // Union field _maximum can be only one of the following:
  "maximum": number
  // End of list of possible types for union field _maximum.
}
欄位
type

enum (Type)

這是必要旗標,資料類型。

properties

map (key: string, value: object (Schema))

選用。Type.OBJECT 的屬性。

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

required[]

string

選用。Type.OBJECT 的必要屬性。

description

string

選用。資料說明。

items

object (Schema)

選用。Type.ARRAY 元素的結構定義。

nullable

boolean

選用。指出值是否可能為空值。

uniqueItems

boolean

選用。指出陣列中的項目不得重複。僅適用於 TYPE.ARRAY。

prefixItems[]

object (Schema)

選用。Type.ARRAY 初始元素的結構定義。

additionalProperties

object (Schema)

選用。可以是布林值或物件,用來控制其他屬性的存在。

anyOf[]

object (Schema)

選用。系統應根據清單中的任何 (一或多個) 子結構定義驗證值。

enum[]

string

選用。可能的值為列舉格式的原始類型元素。範例:1. 我們可以將方向定義為:{type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. 我們可以將公寓號碼定義為:{type:INTEGER, format:enum, enum:["101", "201", "301"]}

default

value (Value format)

選用。資料的預設值。

ref

string

選用。允許在結構定義節點之間建立間接參照。此值應為根 defs 子項的有效參照。

舉例來說,下列結構定義會定義對名為「Pet」的結構節點的參照:

type: object
properties:
  pet:
    ref: #/defs/Pet
defs:
  Pet:
    type: object
    properties:
      name:
        type: string

「pet」屬性的值是參照名為「Pet」的結構定義節點。詳情請參閱 https://json-schema.org/understanding-json-schema/structuring

defs

map (key: string, value: object (Schema))

選用。供 ref 使用的定義對應表。只能在結構定義的根層級使用。

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

title

string

選用。結構定義的標題。

minItems

string (int64 format)

選用。Type.ARRAY 的元素數量下限。

maxItems

string (int64 format)

選用。Type.ARRAY 的元素數量上限。

聯集欄位 _minimum

_minimum 只能是下列其中一項:

minimum

number

選用。Type.INTEGER 和 Type.NUMBER 的最小值。

聯集欄位 _maximum

_maximum 只能是下列其中一項:

maximum

number

選用。Type.INTEGER 和 Type.NUMBER 的最大值。

PropertiesEntry

JSON 表示法
{
  "key": string,
  "value": {
    object (Schema)
  }
}
欄位
key

string

value

object (Schema)

JSON 表示法
{

  // Union field kind can be only one of the following:
  "nullValue": null,
  "numberValue": number,
  "stringValue": string,
  "boolValue": boolean,
  "structValue": {
    object
  },
  "listValue": array
  // End of list of possible types for union field kind.
}
欄位
聯集欄位 kind。值的類型。kind 只能是下列其中一個設定:
nullValue

null

代表 JSON null

numberValue

number

代表 JSON 數字。不得為 NaNInfinity-Infinity,因為 JSON 不支援這些字元。此外,由於 JSON 格式一般不支援數字類型中的大型 Int64 值,因此也無法表示這類值。

stringValue

string

代表 JSON 字串。

boolValue

boolean

代表 JSON 布林值 (JSON 中的 truefalse 常值)。

structValue

object (Struct format)

代表 JSON 物件。

listValue

array (ListValue format)

代表 JSON 陣列。

結構

JSON 表示法
{
  "fields": {
    string: value,
    ...
  }
}
欄位
fields

map (key: string, value: value (Value format))

動態型別值的無序對應。

包含 "key": value 組合清單的物件,範例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

FieldsEntry

JSON 表示法
{
  "key": string,
  "value": value
}
欄位
key

string

value

value (Value format)

ListValue

JSON 表示法
{
  "values": [
    value
  ]
}
欄位
values[]

value (Value format)

動態型別值的重複欄位。

DefsEntry

JSON 表示法
{
  "key": string,
  "value": {
    object (Schema)
  }
}
欄位
key

string

value

object (Schema)

OpenApiToolset

JSON 表示法
{
  "openApiSchema": string,
  "apiAuthentication": {
    object (ApiAuthentication)
  },
  "tlsConfig": {
    object (TlsConfig)
  },
  "serviceDirectoryConfig": {
    object (ServiceDirectoryConfig)
  },
  "ignoreUnknownFields": boolean,
  "url": string
}
欄位
openApiSchema

string

這是必要旗標,工具集的 OpenAPI 結構定義。

apiAuthentication

object (ApiAuthentication)

選用。API 要求的驗證資訊。

tlsConfig

object (TlsConfig)

選用。傳輸層安全標準 (TLS) 設定。包含自訂伺服器憑證

serviceDirectoryConfig

object (ServiceDirectoryConfig)

選用。Service Directory 設定。

ignoreUnknownFields

boolean

選用。如果設為 true,對於 OpenAPI 結構定義中定義的所有作業,代理程式都會忽略 API 回應中的不明欄位。

url

string

選用。開放式 API 結構定義的伺服器網址。如果結構定義包含伺服器網址,則只有在匯出程序期間的環境依附元件中,才會設定這個欄位。在匯入過程中,如果環境依附元件中存在這個網址,且結構定義含有 $env_var 預留位置,系統就會取代結構定義中的預留位置。

ConnectorToolset

JSON 表示法
{
  "connection": string,
  "authConfig": {
    object (EndUserAuthConfig)
  },
  "connectorActions": [
    {
      object (Action)
    }
  ]
}
欄位
connection

string

這是必要旗標,所參照 Integration Connectors 連線的完整資源名稱。格式:projects/{project}/locations/{location}/connections/{connection}

authConfig

object (EndUserAuthConfig)

選用。設定 Integration Connectors 中驗證的處理方式。根據預設,管理員驗證會傳遞至 Integration Connectors API 要求。您可以覆寫這項設定,改用其他使用者驗證設定。注意:連線必須啟用驗證覆寫功能,才能在此指定 EUC 設定,否則工具集建立作業會失敗。詳情請參閱:https://cloud.google.com/application-integration/docs/configure-connectors-task#configure-authentication-override

connectorActions[]

object (Action)

這是必要旗標,要產生工具的連接器動作/實體作業清單。

EndUserAuthConfig

JSON 表示法
{

  // Union field auth_config can be only one of the following:
  "oauth2AuthCodeConfig": {
    object (Oauth2AuthCodeConfig)
  },
  "oauth2JwtBearerConfig": {
    object (Oauth2JwtBearerConfig)
  }
  // End of list of possible types for union field auth_config.
}
欄位
聯集欄位 auth_config。驗證設定。auth_config 只能是下列其中一個設定:
oauth2AuthCodeConfig

object (Oauth2AuthCodeConfig)

Oauth 2.0 授權碼驗證。

oauth2JwtBearerConfig

object (Oauth2JwtBearerConfig)

JWT 設定檔 OAuth 2.0 授權授予驗證。

Oauth2AuthCodeConfig

JSON 表示法
{
  "oauthToken": string
}
欄位
oauthToken

string

這是必要旗標,要傳遞的 OAuth 權杖參數名稱。格式必須為 $context.variables.<name_of_variable>

Oauth2JwtBearerConfig

JSON 表示法
{
  "issuer": string,
  "subject": string,
  "clientKey": string
}
欄位
issuer

string

這是必要旗標,要傳遞的發卡機構參數名稱。格式必須為 $context.variables.<name_of_variable>

subject

string

這是必要旗標,要傳送的主體參數名稱。格式必須為 $context.variables.<name_of_variable>

clientKey

string

這是必要旗標,要傳遞的用戶端參數名稱。格式必須為 $context.variables.<name_of_variable>

動作

JSON 表示法
{
  "inputFields": [
    string
  ],
  "outputFields": [
    string
  ],

  // Union field action_spec can be only one of the following:
  "connectionActionId": string,
  "entityOperation": {
    object (EntityOperation)
  }
  // End of list of possible types for union field action_spec.
}
欄位
inputFields[]

string

選用。做為作業輸入內容的實體欄位。如未指定任何欄位,系統會使用實體的所有欄位。

outputFields[]

string

選用。要從作業傳回的實體欄位。如未指定任何欄位,系統會傳回 Entity 的所有欄位。

聯集欄位 action_spec。工具要使用的動作設定規格。action_spec 只能是下列其中一個設定:
connectionActionId

string

工具要使用的「連線」動作 ID。

entityOperation

object (EntityOperation)

工具要使用的實體作業設定。

EntityOperation

JSON 表示法
{
  "entityId": string,
  "operation": enum (OperationType)
}
欄位
entityId

string

這是必要旗標,實體的 ID。

operation

enum (OperationType)

這是必要旗標,要在實體上執行的作業。

時間長度

JSON 表示法
{
  "seconds": string,
  "nanos": integer
}
欄位
seconds

string (int64 format)

時間範圍的秒數 (可為負值)。必須介於 -315,576,000,000 至 +315,576,000,000 之間 (含頭尾)。注意:這些界限是根據以下公式計算得出:60 秒/分 * 60 分/時 * 24 時/天 * 365.25 天/年 * 10000 年

nanos

integer

時間跨度以奈秒為單位的正負秒數。如果時間長度不到一秒,系統會以 0 seconds 欄位和正數或負數 nanos 欄位表示。如果時間長度為一秒以上,nanos 欄位的非零值必須與 seconds 欄位相同。值必須介於 -999,999,999 到 +999,999,999 之間 (含)。

時間戳記

JSON 表示法
{
  "seconds": string,
  "nanos": integer
}
欄位
seconds

string (int64 format)

代表自 Unix 紀元 1970-01-01T00:00:00Z 起算的世界標準時間秒數。必須介於 -62135596800 和 253402300799 之間 (含),對應至 0001-01-01T00:00:00Z 至 9999-12-31T23:59:59Z。

nanos

integer

以奈秒為單位的非負秒數小數。這個欄位是時間長度的奈秒部分,並非秒數的替代值。如果秒數值為負數,且包含小數,奈秒值仍須為非負數,且會往前計算時間。必須介於 0 至 999,999,999 之間 (含)。

ToolFakeConfig

JSON 表示法
{
  "enableFakeMode": boolean,

  // Union field tool_response can be only one of the following:
  "codeBlock": {
    object (CodeBlock)
  }
  // End of list of possible types for union field tool_response.
}
欄位
enableFakeMode

boolean

選用。工具是否使用模擬模式。

聯集欄位 tool_response。回應可以是靜態,也可以由 Python 函式提供。tool_response 只能是下列其中一個設定:
codeBlock

object (CodeBlock)

選用。要執行的程式碼區塊,而非實際的工具呼叫。

CodeBlock

JSON 表示法
{
  "pythonCode": string
}
欄位
pythonCode

string

這是必要旗標,以工具模擬模式叫用的 Python 程式碼。預期的 Python 函式簽章 - 如要擷取所有工具呼叫: def fake_tool_call(tool: Tool, input: dict[str, Any], callback_context: CallbackContext) -> Optional[dict[str, Any]]: 如要擷取特定工具呼叫: def fake_{tool_id}(tool: Tool, input: dict[str, Any], callback_context: CallbackContext) -> Optional[dict[str, Any]]: 如果函式傳回 None,系統會改為叫用實際工具。

RequestLocation

要求中 API 金鑰的位置。

列舉
REQUEST_LOCATION_UNSPECIFIED 不明。請勿使用此值。
HEADER 代表 HTTP 標頭中的金鑰。
QUERY_STRING 代表查詢字串中的鍵。

OauthGrantType

OAuth 授權類型。系統僅支援用戶端憑證授權

列舉
OAUTH_GRANT_TYPE_UNSPECIFIED 不明。預設為 CLIENT_CREDENTIAL。
CLIENT_CREDENTIAL 代表用戶端憑證流程

類型

OpenAPI 資料型別。

列舉
TYPE_UNSPECIFIED 未指定類型。
STRING 字串類型。
INTEGER 整數類型。
NUMBER 電話號碼類型。
BOOLEAN 布林類型。
OBJECT 物件類型。
ARRAY 陣列類型。

NullValue

代表 JSON null

NullValue 是哨兵,使用只有一個值的列舉,代表 Value 型別聯集的空值。

如果 NullValue 類型的欄位值不是 0,系統就會視為無效。大多數 ProtoJSON 序列化程式都會發出 Value,並將 null_value 設為 JSON null (不論整數值為何),因此會來回傳輸至 0 值。

列舉
NULL_VALUE 空值。

OperationType

要在實體上執行的作業。

列舉
OPERATION_TYPE_UNSPECIFIED 未指定作業類型。無效,ConnectorTool 建立/更新作業將失敗。
LIST 列出作業。
GET 取得作業。
CREATE 建立作業。
UPDATE 更新作業。
DELETE 刪除作業。

ExecutionType

工具或工具組的執行類型。

列舉
EXECUTION_TYPE_UNSPECIFIED 未指定執行類型。如未指定,預設值為 SYNCHRONOUS
SYNCHRONOUS 工具會同步執行。工作階段會遭到封鎖,直到工具傳回為止。
ASYNCHRONOUS 這項工具會以非同步方式執行。工具執行期間,工作階段會繼續進行。

工具註解

工具註解會傳送至 MCP 用戶端,說明特定工具的基本風險。大多數用戶端會將這些提示視為不受信任,但可用於決定何時向使用者傳送確認提示。

除了標題字串外,以下布林提示的定義如下:

  • readOnlyHint:如果為 true,工具不會修改環境。預設值:false。
  • destructiveHint:如果為 true,工具可以執行破壞性動作。如果為 false,工具只能執行加法動作。預設值:true。
  • idempotentHint:如果為 true,以相同引數重複呼叫工具,對環境不會有額外影響。預設值:false。
  • openWorldHint:設為 true 時,工具可以與外部實體的「開放世界」互動。如果為 false,工具只能與內部實體互動。舉例來說,網頁搜尋工具屬於開放世界,記憶體工具則不屬於開放世界。

破壞性提示:✅ | 等冪提示:❌ | 唯讀提示:❌ | 開放世界提示:❌