MCP Tools Reference: people.googleapis.com

工具:search_directory_people

搜尋貴機構 Google Workspace 目錄中的使用者。這項功能僅適用於 Google Workspace 帳戶 (供企業、學校和其他機構使用),不適用於個人 Google 帳戶。

重要規則:

  • 如果這項工具傳回多個結果,您應向使用者顯示結果,並提示使用者釐清要使用哪個結果,再繼續進行。

  • 未經使用者明確確認,嚴禁將這項工具的輸出內容傳遞至其他工具 (例如傳送電子郵件、建立草稿、建立活動等)。

  • 即使只找到一個結果,您也必須向使用者顯示找到的人員詳細資料,並提示使用者確認這是否為目標對象,再繼續進行後續步驟。

  • 如果這項工具未傳回任何結果,請改用 search_contacts 工具。

以下範例示範如何使用 curl 叫用 search_directory_people MCP 工具。

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

輸入內容的結構定義

SearchDirectoryPeople 的要求訊息。

SearchDirectoryPeopleMcpRequest

JSON 表示法
{
  "query": string,
  "pageSize": integer,
  "pageToken": string,
  "sources": [
    enum (DirectorySourceType)
  ]
}
欄位
query

string

要搜尋的查詢字串。

pageSize

integer

頁面大小。預設值為 10,允許的最大值為 500。

pageToken

string

網頁權杖。

sources[]

enum (DirectorySourceType)

要傳回的目錄來源。如未設定,預設值為 DOMAIN_PROFILE。

輸出內容的結構定義

SearchDirectoryPeople 的回應訊息。

SearchDirectoryPeopleMcpResponse

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

object (SearchDirectoryResult)

符合查詢條件的人員清單。

nextPageToken

string

用來擷取下一頁結果的符記。

SearchDirectoryResult

JSON 表示法
{
  "name": string,
  "email": string
}
欄位
name

string

使用者的顯示名稱。

email

string

對方的帳戶電子郵件地址。

工具註解

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