MCP Tools Reference: ces.googleapis.com

工具:get_tool

获取指定工具的详细信息。

以下示例演示了如何使用 curl 调用 get_tool 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": "get_tool",
    "arguments": {
      // provide these details according to the tool's MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'
                

输入架构

AgentService.GetTool 的请求消息。

GetToolRequest

JSON 表示法
{
  "name": string
}
字段
name

string

必需。要检索的工具的资源名称。

输出架构

工具表示 CES 代理可以采取的行动,以实现特定目标。

工具

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

  // Union field tool_type can be only one of the following:
  "clientFunction": {
    object (ClientFunction)
  },
  "openApiTool": {
    object (OpenApiTool)
  },
  "googleSearchTool": {
    object (GoogleSearchTool)
  },
  "connectorTool": {
    object (ConnectorTool)
  },
  "dataStoreTool": {
    object (DataStoreTool)
  },
  "pythonFunction": {
    object (PythonFunction)
  },
  "mcpTool": {
    object (McpTool)
  },
  "fileSearchTool": {
    object (FileSearchTool)
  },
  "systemTool": {
    object (SystemTool)
  },
  "agentTool": {
    object (AgentTool)
  },
  "widgetTool": {
    object (WidgetTool)
  },
  "remoteAgentTool": {
    object (RemoteAgentTool)
  }
  // End of list of possible types for union field tool_type.
}
字段
name

string

标识符。工具的资源名称。格式:

  • projects/{project}/locations/{location}/apps/{app}/tools/{tool} 表示独立工具。
  • 从工具集中检索到的工具的 projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}/tools/{tool}

这些工具是动态的,并且只能输出;在需要工具的地方,无法直接引用这些工具。

displayName

string

仅限输出。工具的显示名称,根据工具的类型派生。例如,[ClientFunction][Tool.ClientFunction] 的显示名称派生自其 name 属性。

executionType

enum (ExecutionType)

可选。工具的执行类型。

timeout

string (Duration format)

可选。工具执行的超时时间。如果未设置,则 SYNCHRONOUS 工具的默认超时时间为 30 秒,ASYNCHRONOUS 工具的默认超时时间为 60 秒。

该时长以秒为单位,最多包含九个小数位,以“s”结尾。示例:"3.5s"

createTime

string (Timestamp format)

仅限输出。工具创建时的时间戳。

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 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 规范化(即转换为 UTC 零时区格式并在末尾附加 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 为空,则更新会覆盖任何并发更改。

generatedSummary

string

仅限输出。如果该工具是由 LLM 助理生成的,则此字段包含生成内容的描述性摘要。

toolFakeConfig

object (ToolFakeConfig)

可选。伪造模式下工具行为的配置。

联合字段 tool_type。工具的类型。tool_type 只能是下列其中一项:
clientFunction

object (ClientFunction)

可选。客户端函数。

openApiTool

object (OpenApiTool)

可选。开放式 API 工具。

googleSearchTool

object (GoogleSearchTool)

可选。Google 搜索工具。

connectorTool

object (ConnectorTool)

可选。Integration Connector 工具。

dataStoreTool

object (DataStoreTool)

可选。数据存储区工具。

pythonFunction

object (PythonFunction)

可选。Python 函数工具。

mcpTool

object (McpTool)

可选。MCP 工具。MCP 工具无法直接创建或更新,而是由 MCP 工具集管理。

fileSearchTool

object (FileSearchTool)

可选。文件搜索工具。

systemTool

object (SystemTool)

可选。系统工具。

agentTool

object (AgentTool)

可选。代理工具。

widgetTool

object (WidgetTool)

可选。微件工具。

remoteAgentTool

object (RemoteAgentTool)

可选。远程代理工具。

ClientFunction

JSON 表示法
{
  "name": string,
  "description": string,
  "parameters": {
    object (Schema)
  },
  "response": {
    object (Schema)
  }
}
字段
name

string

必需。函数名称。

description

string

可选。函数说明。

parameters

object (Schema)

可选。函数参数的架构。

response

object (Schema)

可选。函数响应的架构。

架构

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

可选。指示值是否为 null。

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 值,因此这种格式也无法表示大型 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)

OpenApiTool

JSON 表示法
{
  "openApiSchema": string,
  "name": string,
  "description": string,
  "apiAuthentication": {
    object (ApiAuthentication)
  },
  "tlsConfig": {
    object (TlsConfig)
  },
  "serviceDirectoryConfig": {
    object (ServiceDirectoryConfig)
  },
  "ignoreUnknownFields": boolean,
  "url": string
}
字段
openApiSchema

string

必需。JSON 或 YAML 格式的 OpenAPI 架构。

name

string

可选。工具的名称。如果未提供,工具的名称将从 OpenAPI 架构的 operation.operationId 中派生出来。

description

string

可选。工具的说明。如果未提供,工具的说明将从 OpenAPI 架构(即 operation.descriptionoperation.summary)中派生。

apiAuthentication

object (ApiAuthentication)

可选。API 所需的身份验证信息。

tlsConfig

object (TlsConfig)

可选。TLS 配置。包含客户端将信任的自定义服务器证书。

serviceDirectoryConfig

object (ServiceDirectoryConfig)

可选。Service Directory 配置。

ignoreUnknownFields

boolean

可选。如果为 true,代理将忽略 API 响应中的未知字段。

url

string

可选。Open API 架构的服务器网址。仅当架构包含服务器网址时,此字段才会在导出过程中设置在环境依赖项中的工具中。在导入过程中,如果此网址存在于环境依赖项中,并且架构具有 $env_var 占位符,则该网址将替换架构中的占位符。

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 Secret 版本资源的名称。格式:projects/{project}/secrets/{secret}/versions/{version}

注意:您应向 CES 服务代理 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com 授予 roles/secretmanager.secretAccessor 角色。

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}

注意:您应向 CES 服务代理 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.com 授予 roles/secretmanager.secretAccessor 角色。

tokenEndpoint

string

必需。OAuth 提供方中用于换取访问令牌的令牌端点。

scopes[]

string

可选。要授予的 OAuth 范围。

ServiceAccountAuthConfig

JSON 表示法
{
  "serviceAccount": string,
  "scopes": [
    string
  ]
}
字段
serviceAccount

string

必需。用于身份验证的服务账号的电子邮件地址。CES 使用此服务账号来交换访问令牌,然后在请求的 Authorization 标头中发送该访问令牌。

服务账号必须拥有授予 CES 服务代理 service-<PROJECT-NUMBER>@gcp-sa-ces.iam.gserviceaccount.comroles/iam.serviceAccountTokenCreator 角色。

scopes[]

string

可选。要授予的 OAuth 范围。如果未指定,则使用默认范围 https://www.googleapis.com/auth/cloud-platform

BearerTokenConfig

JSON 表示法
{
  "token": string
}
字段
token

string

必需。不记名令牌。必须采用 $context.variables.<name_of_variable> 格式。

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 服务器证书使用“subject alt name”进行签名。例如,可以使用以下命令自签名证书:

   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 编码的字符串。

ServiceDirectoryConfig

JSON 表示法
{
  "service": string
}
字段
service

string

必需。Service Directory 服务的名称。格式:projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}。服务目录的位置必须与应用的位置相同。

GoogleSearchTool

JSON 表示法
{
  "name": string,
  "description": string,
  "contextUrls": [
    string
  ],
  "preferredDomains": [
    string
  ],
  "excludeDomains": [
    string
  ],
  "promptConfig": {
    object (PromptConfig)
  }
}
字段
name

string

必需。工具的名称。

description

string

可选。工具用途的说明。

contextUrls[]

string

可选。系统会直接从这些网址提取内容,以用于上下文和接地。示例:“https://example.com/path.html”。最多允许添加 20 个网址。

preferredDomains[]

string

可选。指定要将搜索结果限制在哪些网域中。示例:“example.com”“another.site”。最多可以指定 20 个网域。

excludeDomains[]

string

可选。要从搜索结果中排除的网域列表。示例:“example.com”。最多可以排除 2000 个网域。

promptConfig

object (PromptConfig)

可选。传递给规划器的提示指令,用于说明应如何处理文本和语音搜索结果。

PromptConfig

JSON 表示法
{
  "textPrompt": string,
  "voicePrompt": string
}
字段
textPrompt

string

可选。定义在聊天对话中与代理互动时用于系统指令的提示。如果未设置,系统将使用默认提示。

voicePrompt

string

可选。定义在语音对话中与代理互动时用于系统指令的提示。如果未设置,系统将使用默认提示。

ConnectorTool

JSON 表示法
{
  "connection": string,
  "action": {
    object (Action)
  },
  "authConfig": {
    object (EndUserAuthConfig)
  },
  "name": string,
  "description": string
}
字段
connection

string

必需。所引用 Integration Connectors 连接的完整资源名称。格式:projects/{project}/locations/{location}/connections/{connection}

action

object (Action)

必需。供工具使用的操作。

authConfig

object (EndUserAuthConfig)

可选。配置 Integration Connectors 中身份验证的处理方式。默认情况下,管理员身份验证会在 Integration Connectors API 请求中传递。您可以使用其他最终用户身份验证配置来替换它。注意:连接必须启用身份验证替换,才能在此处指定 EUC 配置;否则,ConnectorTool 创建将会失败。如需了解详情,请参阅 https://cloud.google.com/application-integration/docs/configure-connectors-task#configure-authentication-override

name

string

可选。代理可用于决定是否调用此 ConnectorTool 的工具的名称。

description

string

可选。工具的说明,代理可根据此说明来决定是否调用此 ConnectorTool。

操作

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

可选。要从操作中返回的实体字段。如果未指定任何字段,则返回实体的所有字段。

联合字段 action_spec。要配置供工具使用的操作的规范。action_spec 只能是下列其中一项:
connectionActionId

string

供工具使用的连接操作的 ID。

entityOperation

object (EntityOperation)

供工具使用的实体操作配置。

EntityOperation

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

string

必需。实体的 ID。

operation

enum (OperationType)

必需。要对实体执行的操作。

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> 格式。

DataStoreTool

JSON 表示法
{
  "name": string,
  "description": string,
  "boostSpecs": [
    {
      object (BoostSpecs)
    }
  ],
  "modalityConfigs": [
    {
      object (ModalityConfig)
    }
  ],
  "filterParameterBehavior": enum (FilterParameterBehavior),

  // Union field search_source can be only one of the following:
  "dataStoreSource": {
    object (DataStoreSource)
  },
  "engineSource": {
    object (EngineSource)
  }
  // End of list of possible types for union field search_source.
}
字段
name

string

必需。数据存储区工具名称。

description

string

可选。工具说明。

boostSpecs[]

object (BoostSpecs)

可选。用于提升特定文档的提升规范。

modalityConfigs[]

object (ModalityConfig)

可选。数据存储区的模态配置。

filterParameterBehavior

enum (FilterParameterBehavior)

可选。过滤条件参数行为。

联合字段 search_source。定义搜索来源,可以是单个数据存储区或引擎。search_source 只能是下列其中一项:
dataStoreSource

object (DataStoreSource)

可选。在单个特定数据存储区中搜索。

engineSource

object (EngineSource)

可选。在引擎内(可能跨多个数据存储区)进行搜索。

DataStoreSource

JSON 表示法
{
  "filter": string,
  "dataStore": {
    object (DataStore)
  }
}
字段
filter

string

可选。DataStore 的过滤条件规范。请参阅:https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata

dataStore

object (DataStore)

可选。数据存储区。

DataStore

JSON 表示法
{
  "name": string,
  "type": enum (DataStoreType),
  "documentProcessingMode": enum (DocumentProcessingMode),
  "displayName": string,
  "createTime": string,
  "connectorConfig": {
    object (ConnectorConfig)
  }
}
字段
name

string

必需。数据存储区的完整资源名称。格式:projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}

type

enum (DataStoreType)

仅限输出。数据存储区的类型。此字段为只读字段,由服务器填充。

documentProcessingMode

enum (DocumentProcessingMode)

仅限输出。数据存储区连接的文档处理模式。仅针对 PUBLIC_WEB 和 UNSTRUCTURED 数据存储区设置。

displayName

string

仅限输出。数据存储区的显示名称。

createTime

string (Timestamp format)

仅限输出。数据存储区的创建时间。

采用 RFC 3339 标准,生成的输出将始终进行 Z 规范化(即转换为 UTC 零时区格式并在末尾附加 Z),并使用 0、3、6 或 9 个小数位。不带“Z”的偏差时间也是可以接受的。示例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

connectorConfig

object (ConnectorConfig)

仅限输出。数据存储区连接的连接器配置。

时间戳

JSON 表示法
{
  "seconds": string,
  "nanos": integer
}
字段
seconds

string (int64 format)

表示世界协调时间 (UTC) 的秒数(从 Unix 纪元 1970-01-01T00:00:00Z 开始算起)。必须介于 -62135596800 到 253402300799 之间(含边界值),对应于 0001-01-01T00:00:00Z 到 9999-12-31T23:59:59Z。

nanos

integer

秒数的非负小数部分(以纳秒为单位)。此字段是时长的纳秒部分,而不是秒的替代项。对于含小数部分的负秒数,仍必须包含按时间递升的非负纳秒值。必须在 0 到 999,999,999 之间(含边界值)。

ConnectorConfig

JSON 表示法
{
  "collection": string,
  "collectionDisplayName": string,
  "dataSource": string
}
字段
collection

string

数据存储区所属集合的资源名称。

collectionDisplayName

string

数据存储区所属集合的显示名称。

dataSource

string

数据源的名称。示例:salesforcejiraconfluencebigquery

EngineSource

JSON 表示法
{
  "engine": string,
  "dataStoreSources": [
    {
      object (DataStoreSource)
    }
  ],
  "filter": string
}
字段
engine

string

必需。引擎的完整资源名称。格式:projects/{project}/locations/{location}/collections/{collection}/engines/{engine}

dataStoreSources[]

object (DataStoreSource)

可选。用于定位引擎中的特定数据存储区。如果为空,则搜索适用于与 Engine 关联的所有数据存储区。

filter

string

可选。应用于整个引擎搜索的过滤条件。如果提供了“data_store_sources”,则此参数不相关且不会使用。请参阅:https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata

BoostSpecs

JSON 表示法
{
  "dataStores": [
    string
  ],
  "spec": [
    {
      object (BoostSpec)
    }
  ]
}
字段
dataStores[]

string

必需。应用了提升配置的数据存储区。数据存储区的完整资源名称,例如 projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}。

spec[]

object (BoostSpec)

必需。提升规范列表。

BoostSpec

JSON 表示法
{
  "conditionBoostSpecs": [
    {
      object (ConditionBoostSpec)
    }
  ]
}
字段
conditionBoostSpecs[]

object (ConditionBoostSpec)

必需。提升规范列表。

ConditionBoostSpec

JSON 表示法
{
  "condition": string,
  "boost": number,
  "boostControlSpec": {
    object (BoostControlSpec)
  }
}
字段
condition

string

必需。用于指定提升条件的表达式。语法与过滤表达式语法相同。目前,唯一支持的条件是 BCP-47 语言代码列表。示例:提升英语或法语建议的效果:(lang_code: ANY("en", "fr"))

boost

number

可选。提升的强度,应介于 [-1, 1] 之间。设为负值代表降位。 默认值为 0.0。

设置为 1.0 可大幅提升建议的权重。不过,这并不一定意味着最佳结果会是提升后的建议。

设置为 -1.0 会大幅降低建议的权重。不过,系统可能仍会显示其他相关建议。

设置为 0.0 表示不应用任何提升。系统会忽略提升条件。

boostControlSpec

object (BoostControlSpec)

可选。基于客户定义的属性值的自定义排名复杂规范。

BoostControlSpec

JSON 表示法
{
  "fieldName": string,
  "attributeType": enum (AttributeType),
  "interpolationType": enum (InterpolationType),
  "controlPoints": [
    {
      object (ControlPoint)
    }
  ]
}
字段
fieldName

string

可选。将用于确定提升幅度的字段的名称。

attributeType

enum (AttributeType)

可选。用于确定提升幅度的属性类型。属性值可以从指定 field_name 的字段值派生而来。对于数值,这很简单,即 attribute_value = numerical_field_value。不过,对于新鲜度,attribute_value = (time.now() - datetime_field_value)。

interpolationType

enum (InterpolationType)

可选。用于连接下列控制点的插值类型。

controlPoints[]

object (ControlPoint)

可选。用于定义曲线的控制点。单调函数(通过上面的 interpolation_type 定义)会通过此处列出的控制点。

ControlPoint

JSON 表示法
{
  "attributeValue": string,
  "boostAmount": number
}
字段
attributeValue

string

可选。可以是以下值之一:1. 数值字段值。2. 新鲜度对应的时长规范:该值必须采用 XSD dayTimeDuration 值(ISO 8601 时长值的受限子集)的格式。该值的格式为:[nD][T[nH][nM][nS]]

boostAmount

number

可选。如果 attribute_value 的求值结果为上述指定的值,则该字段的值用于提升得分(介于 -1 到 1 之间)。

ModalityConfig

JSON 表示法
{
  "modalityType": enum (ModalityType),
  "rewriterConfig": {
    object (RewriterConfig)
  },
  "summarizationConfig": {
    object (SummarizationConfig)
  },
  "groundingConfig": {
    object (GroundingConfig)
  },
  "snippetsConfig": {
    object (SnippetsConfig)
  }
}
字段
modalityType

enum (ModalityType)

必需。模态类型。

rewriterConfig

object (RewriterConfig)

可选。重写器配置。

summarizationConfig

object (SummarizationConfig)

可选。总结配置。

groundingConfig

object (GroundingConfig)

可选。接地配置。

snippetsConfig

object (SnippetsConfig)

可选。代码段配置。

RewriterConfig

JSON 表示法
{
  "modelSettings": {
    object (ModelSettings)
  },
  "prompt": string,
  "disabled": boolean
}
字段
modelSettings

object (ModelSettings)

必需。LLM 模型的配置。

prompt

string

可选。提示定义。如果未设置,系统将使用默认提示。

disabled

boolean

可选。重写器是否已停用。

ModelSettings

JSON 表示法
{
  "model": string,

  // Union field _temperature can be only one of the following:
  "temperature": number
  // End of list of possible types for union field _temperature.
}
字段
model

string

可选。智能体应使用的 LLM 模型。如果未设置,代理将从其父智能体继承模型。

联合字段 _temperature

_temperature 只能是下列其中一项:

temperature

number

可选。如果设置,系统将使用此温度值来运行 LLM 模型。温度可控制模型回答的随机性。温度越低,生成的回答就越可预测。温度越高,生成的回答就越有创意。

SummarizationConfig

JSON 表示法
{
  "modelSettings": {
    object (ModelSettings)
  },
  "prompt": string,
  "disabled": boolean
}
字段
modelSettings

object (ModelSettings)

可选。LLM 模型的配置。

prompt

string

可选。提示定义。如果未设置,系统将使用默认提示。

disabled

boolean

可选。是否已停用总结功能。

GroundingConfig

JSON 表示法
{
  "groundingLevel": number,
  "disabled": boolean
}
字段
groundingLevel

number

可选。根据检索到的来源得出的回答接地性阈值。该值的可配置范围为 [1, 5]。该级别用于设置回答接地程度的阈值,这意味着接地程度得分低于该阈值的所有回答都将回退到仅返回相关内容片段。

例如,如果该级别为 3,则表示只有当回答的依据充分性得分达到 3 或更高时,系统才会返回回答。

disabled

boolean

可选。接地是否已停用。

SnippetsConfig

JSON 表示法
{
  "enableSnippets": boolean
}
字段
enableSnippets

boolean

可选。是否启用了摘要。

PythonFunction

JSON 表示法
{
  "name": string,
  "pythonCode": string,
  "description": string,
  "serviceDirectoryConfig": {
    object (ServiceDirectoryConfig)
  }
}
字段
name

string

可选。要执行的 Python 函数的名称。必须与 Python 代码中定义的 Python 函数名称匹配。区分大小写。如果未提供名称,系统将使用 Python 代码中定义的第一个函数。

pythonCode

string

可选。要为工具执行的 Python 代码。

description

string

仅限输出。从 Python 代码的文档字符串中解析出的 Python 函数说明。

serviceDirectoryConfig

object (ServiceDirectoryConfig)

可选。工具的 Service Directory 配置。

McpTool

JSON 表示法
{
  "name": string,
  "nameOverride": string,
  "description": string,
  "inputSchema": {
    object (Schema)
  },
  "outputSchema": {
    object (Schema)
  },
  "serverAddress": string,
  "apiAuthentication": {
    object (ApiAuthentication)
  },
  "tlsConfig": {
    object (TlsConfig)
  },
  "serviceDirectoryConfig": {
    object (ServiceDirectoryConfig)
  },
  "customHeaders": {
    string: string,
    ...
  },
  "state": enum (State)
}
字段
name

string

必需。MCP 工具的名称。

nameOverride

string

可选。MCP 工具的名称替换。如果名称被 Toolset 替换项覆盖,则会填充此字段。

description

string

可选。MCP 工具的说明。

inputSchema

object (Schema)

可选。MCP 工具的输入实参的架构。

outputSchema

object (Schema)

可选。MCP 工具的输出实参的架构。

serverAddress

string

必需。MCP 服务器的服务器地址,例如“https://example.com/mcp/”。如果服务器是使用 MCP SDK 构建的,则网址应以“/mcp/”为后缀。仅支持基于可流式传输的 HTTP 传输的服务器。这与 McpToolset 中的 server_address 相同。如需了解详情,请参阅 https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http

apiAuthentication

object (ApiAuthentication)

可选。针对 MCP 服务器执行该工具所需的身份验证信息。对于不记名令牌身份验证,令牌仅适用于工具执行,而不适用于列出工具。这要求无需身份验证即可列出工具。

tlsConfig

object (TlsConfig)

可选。TLS 配置。包含客户端应信任的自定义服务器证书。

serviceDirectoryConfig

object (ServiceDirectoryConfig)

可选。VPC-SC 的 Service Directory 配置,用于解析边界内的服务名称。

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" }

state

enum (State)

仅限输出。外部服务器上工具的动态可用性状态。

CustomHeadersEntry

JSON 表示法
{
  "key": string,
  "value": string
}
字段
key

string

value

string

FileSearchTool

JSON 表示法
{
  "corpusType": enum (CorpusType),
  "name": string,
  "description": string,
  "fileCorpus": string
}
字段
corpusType

enum (CorpusType)

可选。语料库的类型。默认值为 FULLY_MANAGED。

name

string

必需。工具名称。

description

string

可选。工具说明。

fileCorpus

string

可选。存储文件的语料库。格式:projects/{project}/locations/{location}/ragCorpora/{rag_corpus}

SystemTool

JSON 表示法
{
  "name": string,
  "description": string
}
字段
name

string

必需。系统工具的名称。

description

string

仅限输出。系统工具的说明。

AgentTool

JSON 表示法
{
  "name": string,
  "description": string,
  "agent": string
}
字段
name

string

必需。代理工具的名称。

description

string

可选。工具用途的说明。

agent

string

可选。作为工具入口点的代理的资源名称。格式:projects/{project}/locations/{location}/agents/{agent}

WidgetTool

JSON 表示法
{
  "name": string,
  "description": string,
  "widgetType": enum (WidgetType),
  "uiConfig": {
    object
  },
  "dataMapping": {
    object (DataMapping)
  },
  "textResponseConfig": {
    object (TextResponseConfig)
  },

  // Union field input can be only one of the following:
  "parameters": {
    object (Schema)
  }
  // End of list of possible types for union field input.
}
字段
name

string

必需。widget 工具的显示名称。

description

string

可选。widget 工具的说明。

widgetType

enum (WidgetType)

可选。微件工具的类型。如果未指定,则默认类型为 CUSTOMIZED。

uiConfig

object (Struct format)

可选。用于呈现 widget 的配置。

dataMapping

object (DataMapping)

可选。用于定义如何将来源工具中的数据映射到 widget 的输入参数的映射。

textResponseConfig

object (TextResponseConfig)

可选。始终包含的文本回答的配置。

联合字段 input。widget 工具的输入。input 只能是下列其中一项:
parameters

object (Schema)

可选。widget 工具的输入参数。

DataMapping

JSON 表示法
{
  "sourceToolName": string,
  "fieldMappings": {
    string: string,
    ...
  },
  "pythonFunction": {
    object (PythonFunction)
  },
  "mode": enum (Mode),
  "pythonScript": string
}
字段
sourceToolName

string

可选。提供 widget 数据的工具(例如搜索工具或自定义函数)的资源名称。格式:projects/{project}/locations/{location}/agents/{agent}/tools/{tool}

fieldMappings

map (key: string, value: string)

可选。widget 输入参数字段与源工具的相应输出字段之间的映射。

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

pythonFunction

object (PythonFunction)

可选。用于将源工具的输出转换为 widget 的输入格式的 Python 函数的配置。

mode

enum (Mode)

可选。数据映射的模式。

pythonScript
(deprecated)

string

已弃用:请改用 python_function

FieldMappingsEntry

JSON 表示法
{
  "key": string,
  "value": string
}
字段
key

string

value

string

TextResponseConfig

JSON 表示法
{
  "type": enum (Type),
  "staticText": string,
  "textResponseInstruction": string
}
字段
type

enum (Type)

可选。提供文本回答的策略。

staticText

string

可选。当类型为 STATIC 时要返回的静态文本响应。

textResponseInstruction

string

可选。关于 LLM 如何生成文本回答的指令。如果类型为 LLM_GENERATED,则用作文本响应形参的说明。

RemoteAgentTool

JSON 表示法
{
  "name": string,
  "description": string,
  "agentCard": {
    object (AgentCard)
  }
}
字段
name

string

必需。工具的名称。

description

string

必需。工具的说明。

agentCard

object (AgentCard)

必需。此工具调用的远程代理的代理卡片。

AgentCard

JSON 表示法
{
  "name": string,
  "description": string,
  "supportedInterfaces": [
    {
      object (AgentInterface)
    }
  ],
  "version": string,
  "skills": [
    {
      object (AgentSkill)
    }
  ]
}
字段
name

string

必需。代理的人类可读名称。

description

string

必需。代理的操作领域/解决方案空间的说明。

supportedInterfaces[]

object (AgentInterface)

必需。支持的接口的有序列表。第一个条目是首选。

version

string

必需。代理的版本。

skills[]

object (AgentSkill)

必需。技能表示智能体可以执行的能力单位。这可能有些抽象,但代表了一组更集中的行动,智能体很可能成功完成这些行动。

AgentInterface

JSON 表示法
{
  "url": string,
  "protocolBinding": string,
  "tenant": string,
  "protocolVersion": string
}
字段
url

string

必需。相应接口可用的网址。在正式版中,必须是有效的绝对 HTTPS 网址。示例:“https://api.example.com/a2a/v1”“https://grpc.example.com/a2a”

protocolBinding

string

必需。相应网址支持的协议绑定。这是一个开放形式的字符串,可以轻松扩展以用于其他协议绑定。官方支持的核心模型包括 JSONRPCGRPCHTTP+JSON

tenant

string

在调用代理时要在请求中使用的租户 ID。

protocolVersion

string

必需。相应接口公开的 A2A protocol 版本。使用每个主要版本的最新受支持的次要版本。示例:“0.3”“1.0”

AgentSkill

JSON 表示法
{
  "id": string,
  "name": string,
  "description": string,
  "tags": [
    string
  ],
  "examples": [
    string
  ],
  "inputModes": [
    string
  ],
  "outputModes": [
    string
  ]
}
字段
id

string

必需。代理技能的唯一标识符。

name

string

必需。技能的人类可读名称。

description

string

必需。技能的详细说明。

tags[]

string

必需。一组描述技能功能的关键字。

examples[]

string

此技能可处理的提示或场景示例。

inputModes[]

string

相应技能支持的输入媒体类型集,用于替换代理的默认设置。

outputModes[]

string

相应技能支持的一组输出媒体类型,用于替换代理的默认设置。

时长

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

时间跨度的有符号秒数小数部分(以纳秒为单位)。小于 1 秒的时长用 0 seconds 字段和正或负 nanos 字段表示。对于时长为 1 秒或更长时间的视频,nanos 字段的非零值必须与 seconds 字段的符号相同。必须介于 -999,999,999 到 +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,则会改为调用实际工具。

类型

OpenAPI 数据类型。

枚举
TYPE_UNSPECIFIED 未指定类型。
STRING 字符串类型。
INTEGER 整数类型。
NUMBER 数字类型。
BOOLEAN 布尔值类型。
OBJECT 对象类型。
ARRAY 数组类型。

NullValue

表示 JSON null

NullValue 是一个标记,使用仅包含一个值的枚举来表示 Value 类型联合的 null 值。

如果类型为 NullValue 的字段的值不是 0,则视为无效。大多数 ProtoJSON 序列化程序都会发出一个 Value,并将 null_value 设置为 JSON null,无论整数值是多少,因此都会往返于 0 值。

枚举
NULL_VALUE Null 值。

RequestLocation

请求中 API 密钥的位置。

枚举
REQUEST_LOCATION_UNSPECIFIED 未指定。不应使用此值。
HEADER 表示 HTTP 标头中的键。
QUERY_STRING 表示查询字符串中的键。

OauthGrantType

OAuth 授权类型。仅支持客户端凭据授权

枚举
OAUTH_GRANT_TYPE_UNSPECIFIED 未指定。默认值为 CLIENT_CREDENTIAL。
CLIENT_CREDENTIAL 表示客户端凭据流

OperationType

要对实体执行的操作。

枚举
OPERATION_TYPE_UNSPECIFIED 未指定操作类型。无效,ConnectorTool 创建/更新将失败。
LIST 列出操作。
GET 获取操作。
CREATE 创建操作。
UPDATE 更新操作。
DELETE 删除操作。

DataStoreType

数据存储区的类型。

枚举
DATA_STORE_TYPE_UNSPECIFIED 未指定。此值表示未指定数据存储区类型,因此在搜索期间不会使用此值。
PUBLIC_WEB 包含公开网络内容的数据存储区。
UNSTRUCTURED 包含非结构化私有数据的数据存储区。
FAQ 包含用作常见问题解答的结构化数据的数据存储区。
CONNECTOR 一种数据存储区,可连接到第一方或第三方服务。

DocumentProcessingMode

数据存储区的文档处理模式。

枚举
DOCUMENT_PROCESSING_MODE_UNSPECIFIED 未指定。
DOCUMENTS 文档会作为文档进行处理。
CHUNKS 文档会转换为块。

AttributeType

要针对其应用自定义排名的属性(或函数)。

枚举
ATTRIBUTE_TYPE_UNSPECIFIED 未指定 AttributeType。
NUMERICAL 数值字段的值将用于动态更新提升幅度。在这种情况下,控制点的 attribute_value(即 x 值)将是指定了 boost_amount 的数值字段的实际值。
FRESHNESS 对于新鲜度应用场景,属性值将是当前时间与指定日期时间字段中的日期之间的时长。该值必须采用 XSD dayTimeDuration 值(ISO 8601 时长值的受限子集)的格式。该值的格式为:[nD][T[nH][nM][nS]]。例如 5D3DT12H30MT24H

InterpolationType

要应用的插值类型。默认值为线性(分段线性)。

枚举
INTERPOLATION_TYPE_UNSPECIFIED 插值类型未指定。在这种情况下,该字段会默认设置为线性。
LINEAR 系统将应用分段线性插值。

ModalityType

模态类型。

枚举
MODALITY_TYPE_UNSPECIFIED 未指定的模态类型。
TEXT 文本模态。
AUDIO 音频模态。

FilterParameterBehavior

过滤参数行为。

枚举
FILTER_PARAMETER_BEHAVIOR_UNSPECIFIED 默认过滤行为。为连接器数据存储区添加了过滤条件参数。对于其余数据存储区类型,过滤条件输入参数会被省略。
ALWAYS_INCLUDE 始终为所有数据存储区类型添加过滤条件参数。
NEVER_INCLUDE 无论数据存储区类型如何,过滤条件参数都绝不会包含在工具参数列表中。

表示工具的动态可用性状态。

枚举
STATE_UNSPECIFIED 默认状态。
ACTIVE 该工具可用,并且服务器正在主动提供该工具。
INACTIVE 该工具已配置或固定,但目前服务器未提供该工具。
STALE 该工具存在于服务器上,但与服务器上的版本不匹配。

CorpusType

Vertex RAG 语料库的类型。

枚举
CORPUS_TYPE_UNSPECIFIED 未指定的语料库类型。
USER_OWNED 语料库由用户创建并归用户所有。
FULLY_MANAGED 语料库由代理创建。

WidgetType

所有可用的 widget 类型。将来可能会向此枚举添加新值。

枚举
WIDGET_TYPE_UNSPECIFIED 未指定 widget 类型。
CUSTOM 自定义 widget 类型。
PRODUCT_DETAILS 商品详情 widget。
QUICK_ACTIONS “快速操作”widget。
PRODUCT_COMPARISON 商品比较微件。
ADVANCED_PRODUCT_DETAILS 高级商品详情微件。
SHORT_FORM 简短表单 widget。
OVERALL_SATISFACTION 总体满意度 widget。
ORDER_SUMMARY 订单摘要微件。
APPOINTMENT_DETAILS 预约详情 widget。
APPOINTMENT_SCHEDULER 预约安排工具微件。
CONTACT_FORM 联系表单微件。

模式

用于将数据从源工具映射到 widget 的策略。

枚举
MODE_UNSPECIFIED 未指定模式。
FIELD_MAPPING 使用 field_mappings 映射进行数据转换。
PYTHON_SCRIPT 使用 python_script 进行数据转换。

类型

定义如何生成文本回答。

枚举
TYPE_UNSPECIFIED 未指定的类型。
NONE LLM 会根据对话上下文动态决定是否在 widget 旁边生成文本回答。
LLM_GENERATED 明确要求 LLM 生成文本回答。
STATIC 始终使用预定义的静态文本响应。

ExecutionType

工具或工具集的执行类型。

枚举
EXECUTION_TYPE_UNSPECIFIED 执行类型未指定。如果未指定,则默认为 SYNCHRONOUS
SYNCHRONOUS 该工具会同步执行。会话会被阻塞,直到工具返回。
ASYNCHRONOUS 该工具以异步方式执行。在工具执行期间,会话将继续。

工具注释

破坏性提示:❌ | 等幂性提示:✅ | 只读提示:✅ | 开放世界提示:❌