MCP Tools Reference: ces.googleapis.com

工具:list_conversations

列出對話。

下列範例示範如何使用 curl 叫用 list_conversations MCP 工具。

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

輸入內容的結構定義

AgentService.ListConversations 的要求訊息。

ListConversationsRequest

JSON 表示法
{
  "parent": string,
  "pageSize": integer,
  "pageToken": string,
  "filter": string,
  "source": enum (Source),
  "sources": [
    enum (Source)
  ]
}
欄位
parent

string

這是必要旗標,要列出對話的應用程式資源名稱。

pageSize

integer

選用。要求的頁面大小。伺服器傳回的項目數量可能會少於要求數量。如未指定,伺服器會挑選適當的預設值。

pageToken

string

選用。先前的清單 AgentService.ListConversations 呼叫傳回的 next_page_token 值。

filter

string

選用。列出對話時要套用的篩選器。詳情請參閱 https://google.aip.dev/160

source

enum (Source)

選用。指明對話來源。如未設定,系統預設會套用 Source.Live。將淘汰,改用 sources 欄位。

sources[]

enum (Source)

選用。指出對話來源。如未設定,系統預設會套用所有可用來源。

輸出內容的結構定義

AgentService.ListConversations 的回應訊息。

ListConversationsResponse

JSON 表示法
{
  "conversations": [
    {
      object (Conversation)
    }
  ],
  "nextPageToken": string
}
欄位
conversations[]

object (Conversation)

對話清單。

nextPageToken

string

可做為 ListConversationsRequest.page_token 傳送的權杖,用於擷取後續網頁。如果沒有這個欄位,表示沒有後續頁面。

對話

JSON 表示法
{
  "name": string,
  "startTime": string,
  "endTime": string,
  "turns": [
    {
      object (Turn)
    }
  ],
  "turnCount": integer,
  "channelType": enum (ChannelType),
  "source": enum (Source),
  "inputTypes": [
    enum (InputType)
  ],
  "entryAgent": string,
  "deployment": string,
  "appVersion": string,
  "languageCode": string,
  "messages": [
    {
      object (Message)
    }
  ]
}
欄位
name

string

ID。對話的專屬 ID。格式:projects/{project}/locations/{location}/apps/{app}/conversations/{conversation}

startTime

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"

endTime

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"

turns[]

object (Turn)

這是必要旗標,對話中的輪流發言。

turnCount

integer

僅供輸出。對話中的輪流發言次數。

channelType
(deprecated)

enum (ChannelType)

已淘汰。請改用 input_types

source

enum (Source)

僅供輸出。指出對話來源。

inputTypes[]

enum (InputType)

僅供輸出。對話的輸入類型。

entryAgent

string

僅供輸出。最初處理對話的代理程式。如未指定,對話會由根層級代理程式處理。格式:projects/{project}/locations/{location}/apps/{app}/agents/{agent}

deployment

string

僅供輸出。用於處理對話的應用程式部署作業。格式:projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}

appVersion

string

僅供輸出。用於處理對話的應用程式版本。格式:projects/{project}/locations/{location}/apps/{app}/versions/{version}

languageCode

string

僅供輸出。對話的語言代碼。

messages[]
(deprecated)

object (Message)

已淘汰,請改用「回合」。

時間戳記

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 之間 (含)。

Turn

JSON 表示法
{
  "messages": [
    {
      object (Message)
    }
  ],
  "rootSpan": {
    object (Span)
  }
}
欄位
messages[]

object (Message)

選用。對話回合中的訊息清單,包括使用者輸入內容、代理程式回覆,以及處理期間的中繼事件。

rootSpan

object (Span)

選用。動作處理的根範圍。

訊息

JSON 表示法
{
  "role": string,
  "chunks": [
    {
      object (Chunk)
    }
  ],
  "eventTime": string
}
欄位
role

string

選用。對話中的角色,例如使用者、代理程式。

chunks[]

object (Chunk)

選用。訊息內容,以一系列區塊的形式呈現。

eventTime

string (Timestamp format)

選用。傳送或接收郵件/訊息時的時間戳記。如果訊息屬於 example,則不應使用此屬性。

使用 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"

Chunk

JSON 表示法
{

  // Union field data can be only one of the following:
  "text": string,
  "transcript": string,
  "blob": {
    object (Blob)
  },
  "payload": {
    object
  },
  "image": {
    object (Image)
  },
  "toolCall": {
    object (ToolCall)
  },
  "toolResponse": {
    object (ToolResponse)
  },
  "agentTransfer": {
    object (AgentTransfer)
  },
  "updatedVariables": {
    object
  },
  "defaultVariables": {
    object
  }
  // End of list of possible types for union field data.
}
欄位
聯集欄位 data。將資料分塊。data 只能是下列其中一個設定:
text

string

選用。文字資料。

transcript

string

選用。與音訊相關的轉錄稿。

blob

object (Blob)

選用。Blob 資料。

payload

object (Struct format)

選用。自訂酬載資料。

image

object (Image)

選用。圖片資料。

toolCall

object (ToolCall)

選用。工具執行要求。

toolResponse

object (ToolResponse)

選用。工具執行回應。

agentTransfer

object (AgentTransfer)

選用。代理程式轉移事件。

updatedVariables

object (Struct format)

結構體代表對話中更新的變數,並以變數名稱做為鍵。

defaultVariables

object (Struct format)

結構體代表對話開始時的預設變數,並以變數名稱做為鍵。

Blob

JSON 表示法
{
  "mimeType": string,
  "data": string
}
欄位
mimeType

string

這是必要旗標,來源資料的 IANA 標準 MIME 類型。

data

string (bytes format)

這是必要旗標,Blob 的原始位元組。

Base64 編碼字串。

結構

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)

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

代表空值。

numberValue

number

表示雙精度浮點數值。

stringValue

string

代表字串值。

boolValue

boolean

表示布林值。

structValue

object (Struct format)

代表結構化值。

listValue

array (ListValue format)

代表重複的 Value

ListValue

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

value (Value format)

動態型別值的重複欄位。

圖片

JSON 表示法
{
  "mimeType": string,
  "data": string
}
欄位
mimeType

string

這是必要旗標,來源資料的 IANA 標準 MIME 類型。支援的圖片類型包括: * image/png * image/jpeg * image/webp

data

string (bytes format)

這是必要旗標,圖片的原始位元組。

Base64 編碼字串。

ToolCall

JSON 表示法
{
  "id": string,
  "displayName": string,
  "args": {
    object
  },

  // Union field tool_identifier can be only one of the following:
  "tool": string,
  "toolsetTool": {
    object (ToolsetTool)
  }
  // End of list of possible types for union field tool_identifier.
}
欄位
id

string

選用。工具呼叫的專屬 ID。如果已填入,用戶端應傳回執行結果,並在 ToolResponse 中提供相符的 ID。

displayName

string

僅供輸出。工具的顯示名稱。

args

object (Struct format)

選用。工具的輸入參數和值,採用 JSON 物件格式。

聯集欄位 tool_identifier。要執行的工具 ID。可以是持續性工具,也可以是工具集中的工具。tool_identifier 只能是下列其中一個設定:
tool

string

選用。要執行的工具名稱。格式:projects/{project}/locations/{location}/apps/{app}/tools/{tool}

toolsetTool

object (ToolsetTool)

選用。要執行的工具集工具。

ToolsetTool

JSON 表示法
{
  "toolset": string,
  "toolId": string
}
欄位
toolset

string

這是必要旗標,衍生此工具的工具集資源名稱。格式:projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}

toolId

string

選用。用於篩選工具的工具 ID,可擷取結構定義。

ToolResponse

JSON 表示法
{
  "id": string,
  "displayName": string,
  "response": {
    object
  },

  // Union field tool_identifier can be only one of the following:
  "tool": string,
  "toolsetTool": {
    object (ToolsetTool)
  }
  // End of list of possible types for union field tool_identifier.
}
欄位
id

string

選用。tool call 回應的相符 ID。

displayName

string

僅供輸出。工具的顯示名稱。

response

object (Struct format)

這是必要旗標,JSON 物件格式的工具執行結果。使用「output」鍵指定工具回應,並使用「error」鍵指定錯誤詳細資料 (如有)。如果未指定「output」和「error」鍵,系統會將整個「response」視為工具執行結果。

聯集欄位 tool_identifier。已執行的工具 ID。可以是持續性工具,也可以是工具集中的工具。tool_identifier 只能是下列其中一個設定:
tool

string

選用。要執行的工具名稱。格式:projects/{project}/locations/{location}/apps/{app}/tools/{tool}

toolsetTool

object (ToolsetTool)

選用。執行的工具集工具。

AgentTransfer

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

string

這是必要旗標,要將對話轉移給哪位服務專員。服務專員會接手後續對話。格式:projects/{project}/locations/{location}/apps/{app}/agents/{agent}

displayName

string

僅供輸出。代理程式的顯示名稱。

時距

JSON 表示法
{
  "name": string,
  "startTime": string,
  "endTime": string,
  "duration": string,
  "attributes": {
    object
  },
  "childSpans": [
    {
      object (Span)
    }
  ]
}
欄位
name

string

僅供輸出。範圍的名稱。

startTime

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"

endTime

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"

duration

string (Duration format)

僅供輸出。時距長度。

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

attributes

object (Struct format)

僅供輸出。與範圍相關聯的鍵/值屬性。

childSpans[]

object (Span)

僅供輸出。這個範圍下巢狀的子範圍。

時間長度

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 之間 (含)。

工具註解

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