工具:search_contacts
搜尋使用者的聯絡人。
重要規則:
如果這項工具傳回多個結果,您應向使用者顯示結果,並提示使用者釐清要使用哪個結果,再繼續進行。
未經使用者明確確認,嚴禁將這項工具的輸出內容傳遞至其他工具 (例如傳送電子郵件、建立草稿、建立活動等)。
即使只找到一個結果,您也必須向使用者顯示找到的人員詳細資料,並提示使用者確認這是否為目標對象,再繼續進行後續步驟。
以下範例示範如何使用 curl 叫用 search_contacts 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_contacts", "arguments": { // provide these details according to the tool MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
輸入內容的結構定義
SearchContacts 的要求訊息。
SearchContactsMcpRequest
| JSON 表示法 |
|---|
{ "query": string, "maxResults": integer } |
| 欄位 | |
|---|---|
query |
要搜尋的查詢字串。 |
maxResults |
結果數上限。預設值為 10,允許的最大值為 30。 |
輸出內容的結構定義
SearchContacts 的回應訊息。
SearchContactsMcpResponse
| JSON 表示法 |
|---|
{
"results": [
{
object ( |
| 欄位 | |
|---|---|
results[] |
符合查詢條件的聯絡人清單。 |
SearchContactsResult
| JSON 表示法 |
|---|
{ "name": string, "email": string } |
| 欄位 | |
|---|---|
name |
聯絡人的顯示名稱。 |
email |
聯絡人的帳戶電子郵件地址。 |
工具註解
破壞性提示:❌ | 等冪提示:✅ | 唯讀提示:✅ | 開放世界提示:❌