rag_index_directory
Batch-ingests all files from a local directory into a knowledge base, with recursive scanning and a max_files cap to prevent timeouts on large folders.
Instructions
批量扫描并摄取本地目录下的所有文件,支持递归遍历与 max_files 超时防御截断。
Args:
kb_name: 目标知识库名称
dir_path: 目标目录绝对或相对路径
glob_pattern: 匹配文件模式(默认为 "**/*")
max_files: 目录文件摄取上限,防止大目录导致 MCP 响应超时(默认 200)
recursive: 是否递归扫描子目录(默认 True)
Returns:
dict[str, Any]: 目录批量摄取统计报告字典
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"kb_name": "<kb_name>",
"dir_path": "<dir_path>"
},
"name": "rag_index_directory"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kb_name | Yes | ||
| dir_path | Yes | ||
| max_files | No | ||
| recursive | No | ||
| glob_pattern | No | **/* |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||