MCP Tools Reference: developerknowledge.googleapis.com

工具:get_document

使用此工具可检索单个文档的完整内容。文档名称应从对 search_documents 工具的调用结果的 parent 字段中获取。如果您需要检索多个文档,请改用 batch_get_documents

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

输入架构

get_document 的请求架构。

GetDocumentRequest

JSON 表示法
{
  "name": string
}
字段
name

string

必填。要检索的文档的名称。格式:documents/{uri_without_scheme} 示例:documents/docs.cloud.google.com/storage/docs/creating-buckets

输出架构

Document 表示开发者知识语料库中的一段内容。

文档

JSON 表示法
{
  "name": string,
  "uri": string,
  "content": string,
  "description": string
}
字段
name

string

标识符。相应文档的资源名称。格式: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 格式)。

如果搜索结果中返回了相应文档,此字段会包含与搜索查询相关的文本片段。如果此文档是由 get_document 或 batch_get_documents 返回的,则此字段包含完整的文档内容。

description

string

仅限输出。文档的说明。

工具注释

破坏性提示:❌ | 等幂性提示:✅ | 只读提示:✅ | 开放世界提示:❌