lean_declaration_file
Retrieve the declaration source of a symbol in a Lean file, with optional context lines or the full file. Ideal for analyzing theorem definitions and proofs.
Instructions
Get the source of a symbol's declaration (declaration slice + context).
Set full_file=True for the whole file (can be very large).Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | Symbol (case sensitive, must be in file) | |
| 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 |