lean_declaration_file
Retrieve Lean declaration source by file path and symbol, including its line range and configurable surrounding context; optionally return the entire file.
Instructions
Get declaration source with the source-line range and surrounding context.
Generated declarations include their source declaration when it is clear.
Set full_file=True for the whole file (can be very large).Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Case-sensitive Lean name in the file or project environment | |
| file_path | Yes | Absolute or project-root-relative path to Lean file | |
| full_file | No | Return the entire declaration file (large!) | |
| context_lines | No | Lines of context around the declaration |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Declaration source (sliced unless full_file=True) | |
| end_line | No | Last line of the returned slice (1-indexed) | |
| file_path | Yes | Path to declaration file | |
| start_line | No | First line of the returned slice (1-indexed) | |
| total_lines | No | Total lines in the declaration file | |
| source_declaration | No | Source declaration for a generated declaration such as one created by @[to_additive], when it can be determined reliably | |
| declaration_end_line | No | Declaration end line (1-indexed), when known | |
| declaration_start_line | No | Declaration start line (1-indexed) |