工具: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 tool's MCP 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 |
包含區塊的內容。 |
工具註解
破壞性提示:❌ | 等冪提示:✅ | 唯讀提示:✅ | 開放世界提示:❌