get_file_context
Retrieve source code context around a matched line, marking the target with '>' to determine if it is a definition, call, or configuration.
Instructions
读取一次代码搜索命中位置周围带行号的源码上下文。
应在 search_code 返回候选命中后调用,并原样传入该命中的 repo、path 和
line。适合确认命中属于定义、调用还是配置,以及在回答用户前理解附近
的控制流。返回内容以 > 标出目标行,并包含实际起止行、文件总行数
和是否截断。不要用它搜索未知文件,也不要传入绝对路径或 .. 路径。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | search_code 命中结果中的 path 字段;必须是仓库内相对路径 | |
| repository | Yes | search_code 命中结果中的 repo 字段(仓库名称) | |
| line_number | Yes | search_code 命中结果中的 line 字段(从 1 开始) | |
| lines_after | No | 目标行之后返回的源码行数,默认 20 | |
| lines_before | No | 目标行之前返回的源码行数,默认 20 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| end_line | Yes | ||
| file_path | Yes | ||
| truncated | No | ||
| repository | Yes | ||
| start_line | Yes | ||
| target_line | Yes | ||
| total_lines | Yes |