MCP Tools Reference: developerknowledge.googleapis.com

工具:get_documents

使用這項工具,即可在單一呼叫中擷取單一文件或最多 20 份文件的完整內容。文件名稱應從呼叫 search_documents 工具的結果 parent 欄位取得。將 names 參數設為文件名稱清單。

以下範例示範如何使用 curl 叫用 get_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": "get_documents",
    "arguments": {
      // provide these details according to the tool's MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'
                

輸入內容的結構定義

get_documents 的要求結構定義。

GetDocumentsRequest

JSON 表示法
{
  "names": [
    string
  ]
}
欄位
names[]

string

必填。要擷取的文件名稱,由 search_documents 傳回。單一呼叫最多可擷取 20 份文件。系統傳回文件的順序與要求中的 names 相同。格式:documents/{uri_without_scheme} 範例:documents/docs.cloud.google.com/storage/docs/creating-buckets

輸出內容的結構定義

get_documents 的回應結構定義。

GetDocumentsResponse

JSON 表示法
{
  "documents": [
    {
      object (Document)
    }
  ]
}
欄位
documents[]

object (Document)

我們已要求您提供文件。

文件

JSON 表示法
{
  "name": string,
  "uri": string,
  "content": string,
  "description": string,
  "title": string
}
欄位
name

string

ID。文件的資源名稱。格式:documents/{uri_without_scheme} 範例:documents/docs.cloud.google.com/storage/docs/creating-buckets

uri

string

僅供輸出。內容的 URI,例如 https://cloud.google.com/storage/docs/creating-buckets

content

string

僅供輸出。Markdown 格式的文件內容。

description

string

僅供輸出。文件說明。

title

string

僅供輸出。文件的標題。

工具註解

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