工具: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 |
必填。要检索的文档的名称。格式: |
输出架构
Document 表示开发者知识语料库中的一段内容。
文档
| JSON 表示法 |
|---|
{ "name": string, "uri": string, "content": string, "description": string } |
| 字段 | |
|---|---|
name |
标识符。相应文档的资源名称。格式: |
uri |
仅限输出。内容的 URI,例如 |
content |
仅限输出。文档的内容(采用 Markdown 格式)。 如果搜索结果中返回了相应文档,此字段会包含与搜索查询相关的文本片段。如果此文档是由 get_document 或 batch_get_documents 返回的,则此字段包含完整的文档内容。 |
description |
仅限输出。文档的说明。 |
工具注释
破坏性提示:❌ | 等幂性提示:✅ | 只读提示:✅ | 开放世界提示:❌