工具:batch_get_documents
您可以使用此工具通过一次调用检索最多 20 份文档的完整内容。文档名称应从对 search_documents 工具的调用结果的 parent 字段中获取。使用此工具,而不是多次调用 get_document 来提取多个文档。
以下示例演示了如何使用 curl 调用 batch_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": "batch_get_documents", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
输入架构
batch_get_documents 的请求架构。
BatchGetDocumentsRequest
| JSON 表示法 |
|---|
{ "names": [ string ] } |
| 字段 | |
|---|---|
names[] |
必需。要检索的文档的名称,由 search_documents 返回。一个批次最多可以检索 20 个文档。返回的文档与请求中的 |
输出架构
针对 batch_get_documents 的响应架构。
BatchGetDocumentsResponse
| JSON 表示法 |
|---|
{
"documents": [
{
object ( |
| 字段 | |
|---|---|
documents[] |
已请求文件。 |
文档
| JSON 表示法 |
|---|
{ "name": string, "uri": string, "content": string, "description": string } |
| 字段 | |
|---|---|
name |
标识符。相应文档的资源名称。格式: |
uri |
仅限输出。内容的 URI,例如 |
content |
仅限输出。文档的内容(采用 Markdown 格式)。 如果搜索结果中返回了相应文档,此字段会包含与搜索查询相关的文本片段。如果此文档是由 get_document 或 batch_get_documents 返回的,则此字段包含完整的文档内容。 |
description |
仅限输出。文档的说明。 |
工具注释
破坏性提示:❌ | 等幂性提示:✅ | 只读提示:✅ | 开放世界提示:❌