get_symbol
Retrieve the source code of a function, class, or constant with live-verified line bounds. Also supports reading specific line ranges and omission references.
Instructions
Read one function/class/constant with live-verified line bounds.
Raw source of one indexed symbol, bounded (~600 lines) — cheaper than
Read+offset math. ``source`` uses Read's exact line-numbered format;
treat it as an already-performed Read. ``verified: true`` = bounds
checked (or corrected) against the live file: no follow-up Read needed.
``bounds: "approximate"`` = the symbol moved and re-location failed.
An ambiguous id (overloads, re-exports) returns ALL matching bodies in
``candidates`` — none is silently chosen. Also serves live range reads
("path.py:140-180", ≤200 lines, always verified) and omission refs
("repowise#<12-hex>"). Index misses grep the live file and return
fallback_lines instead of a dead end. When ``truncated`` is true the
response carries a ``continuation`` token — the exact range read that
fetches the remainder; pass it straight back to get_symbol.
Args:
symbol_id: "path/to/file.py::Name" (from get_context),
"path/to/file.py:140-180" for a live range, or an omission ref.
context_lines: extra lines before/after (0-50).
repo: usually omitted.
query: omission refs only — regex/substring filter on lines.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | No | ||
| query | No | ||
| symbol_id | Yes | ||
| context_lines | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |