expand_context_tool
Fetches the previous and next chunks for a search result to restore surrounding context and improve retrieval accuracy.
Instructions
擴展 Chunk 上下文(Small-to-Big Retrieval)
search_knowledge 命中某個 chunk 後,用此工具取得 該 chunk 的「前一段」與「後一段」完整內容, 補充搜尋結果的上下文脈絡。
Args: chunk_id: 搜尋結果 context.chunk_id parent_id: 搜尋結果 context.parent_id
Returns: { "before": {id, header_path, content, preview} | null, "current": {id, header_path, content, preview}, "after": {id, header_path, content, preview} | null }
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": {
"chunk_id": "<chunk_id>",
"parent_id": "<parent_id>"
},
"name": "expand_context_tool"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chunk_id | Yes | ||
| parent_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||