工具: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[] |
必需。要检索的文档的名称,由 search_documents 返回。一次调用最多可检索 20 篇文档。返回的文档与请求中的 |
输出架构
get_documents 的响应架构。
GetDocumentsResponse
| JSON 表示法 |
|---|
{
"documents": [
{
object ( |
| 字段 | |
|---|---|
documents[] |
已请求文件。 |
文档
| JSON 表示法 |
|---|
{ "name": string, "uri": string, "content": string, "description": string, "title": string } |
| 字段 | |
|---|---|
name |
标识符。文档的资源名称。格式: |
uri |
仅限输出。内容的 URI,例如 |
content |
仅限输出。文档的内容(采用 Markdown 格式)。 |
description |
仅限输出。文档的说明。 |
title |
仅限输出。文档标题。 |
工具注释
破坏性提示:❌ | 等幂性提示:✅ | 只读提示:✅ | 开放世界提示:❌