MCP Tools Reference: developerknowledge.googleapis.com

工具:search_documents

使用這項工具尋找 Google 開發人員產品的說明文件。這些文件包含官方 API、程式碼片段、版本說明、最佳做法、指南、偵錯資訊等。涵蓋的產品和網域如下:

  • Android:developer.android.com
  • Apigee:docs.apigee.com
  • Chrome:developer.chrome.com
  • Firebase:firebase.google.com
  • Fuchsia:fuchsia.dev
  • Google AI:ai.google.dev
  • Google Cloud:docs.cloud.google.com
  • Google 開發人員、Google Ads、Google 搜尋、Google 地圖、YouTube:developers.google.com
  • Google Home:developers.home.google.com
  • TensorFlow:www.tensorflow.org
  • 網站:web.dev

這項工具會傳回相符文件的文字塊、名稱和網址。如果傳回的區塊不夠詳細,無法回答使用者的問題,請使用 get_documents 和這項工具輸出內容中的 parent,擷取完整的文件內容。

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

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

輸入內容的結構定義

請提供 search_documents 的要求結構定義。使用查詢欄位搜尋相關的 Google 開發人員說明文件。

SearchDocumentChunksRequest

JSON 表示法
{
  "query": string
}
欄位
query

string

必填。使用者提供的原始查詢字串,例如「如何建立 Cloud Storage bucket?」。

輸出內容的結構定義

search_documents 的回應結構定義。

SearchDocumentChunksResponse

JSON 表示法
{
  "results": [
    {
      object (DocumentChunk)
    }
  ]
}
欄位
results[]

object (DocumentChunk)

指定查詢的搜尋結果。這份清單中的每份文件都包含與搜尋查詢相關的內容摘要。使用每個結果的 DocumentChunk.name 欄位搭配 get_documents,即可擷取完整的文件內容。

DocumentChunk

JSON 表示法
{
  "parent": string,
  "id": string,
  "content": string
}
欄位
parent

string

僅供輸出。此區塊所屬文件的資源名稱。格式:documents/{uri_without_scheme} 範例:documents/docs.cloud.google.com/storage/docs/creating-buckets

id

string

僅供輸出。文件內這個區塊的 ID。區塊 ID 在文件中不得重複,但不同文件可以重複使用。區塊 ID 不穩定,可能會隨著時間而改變。

content

string

僅供輸出。文件區塊的內容。

工具註解

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