工具:search_documentation
搜尋並擷取 Google Pay 和 Google 錢包官方開發人員說明文件和程式碼範例中,最相關且最新的部分。
以下程式碼範例說明如何使用 curl 呼叫 search_documentation MCP 工具。
| Curl 要求 |
|---|
curl --location 'https://paydeveloper.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "search_documentation", "arguments": { // Provide these details according to the MCP tool specification. } }, "jsonrpc": "2.0", "id": 1 }' |
輸入內容的結構定義
搜尋說明文件的要求訊息。
SearchDocumentationRequest
| JSON 表示法 |
|---|
{ "userQuery": string, "languageCode": string } |
| 欄位 | |
|---|---|
userQuery |
此為必要項目。要搜尋的查詢。 |
languageCode |
(選填) 搜尋查詢的 IETF BCP-47 語言代碼。 |
輸出內容的結構定義
搜尋文件的回應訊息。
SearchDocumentationResponse
| JSON 表示法 |
|---|
{
"results": [
{
object ( |
| 欄位 | |
|---|---|
results[] |
符合搜尋查詢的文件分塊,並依關聯性分數排序,該分數會評估使用者查詢與分塊內容的相似度。 |
DocumentChunk
| JSON 表示法 |
|---|
{ "title": string, "uri": string, "content": string } |
| 欄位 | |
|---|---|
title |
指定區塊所屬文件的標題。 |
uri |
指定區塊所屬文件的 URI。 |
content |
包含區塊的內容。 |
工具註解
工具註解會傳送至 MCP 用戶端,說明特定工具的基本風險。大多數用戶端會將這些提示視為不受信任,但可用於決定何時向使用者傳送確認提示。
除了標題字串外,下列布林值提示的定義如下:
readOnlyHint:如果為 true,工具不會修改環境。預設值:false。destructiveHint:如果為 true,工具可以執行破壞性動作。如果為 false,則工具只能執行附加動作。預設值:true。idempotentHint:如果設為 true,則使用相同引數重複呼叫工具,不會對環境造成額外影響。預設值:false。openWorldHint:如果設為 true,工具就能與外部實體的「開放世界」互動。如果設為 false,工具只能與內部實體互動。舉例來說,網頁搜尋工具屬於開放世界,而記憶工具則不屬於開放世界。
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌