get_symbol
Raw source bytes for one indexed symbol with exact line bounds — cheaper and safer than reading the whole file and counting offsets. The only MCP tool that returns actual source code.
Every other tool returns context about code. get_symbol returns the
code itself — the raw source bytes of a single indexed symbol with
its exact start/end lines. It's the precise, bounded alternative to a
full-file Read followed by offset arithmetic. It also resolves
omission refs (repowise#<12-hex>) from truncated responses.
When to call
- You need one function or class body, not the whole file.
- After
get_context— pipe thesymbol_idfrom its symbol list straight in. - To confirm a signature or implementation before editing, without pulling 800 unrelated lines into the context window.
- To restore truncated content — when a response's
_meta.omittedlists refs and you have no shell forrepowise expand(e.g. Claude Desktop).
Parameters
Prop
Type
Returns
| Field | Meaning |
|---|---|
symbol_id | The resolved canonical id |
source | The symbol's source bytes (bounded at ~400 lines) |
start_line, end_line | Exact 1-based line bounds in the file |
kind | function, class, method, … |
language | Detected language tag |
truncated | true if the body exceeded the line bound and was cut |
On a miss, returns { error: "Symbol not found …" } with the closest
candidate ids so the agent can retry without another get_context call.
For an omission ref, returns the stored content plus provenance
(source, created_at, original_tokens) instead.
Example
get_symbol("src/auth/service.py::AuthService")
get_symbol(
symbol_id="src/auth/service.py::login",
context_lines=10,
)
# Restore content a truncated response stashed behind a marker
get_symbol("repowise#a1b2c3d4e5f6")
get_symbol("repowise#a1b2c3d4e5f6", query="FAILED")Things worth knowing
- Deterministic on overloads. When a name resolves to more than one definition, resolution is stable — the same id always returns the same symbol.
- Separator-agnostic.
file.py::Name,file.py.Name, andfile.py/Nameall resolve; use whateverget_contexthanded you. - Bounded by design. The ~400-line cap keeps a single call from
blowing the context window on a giant generated file;
truncatedtells you when that happened.
Pair it with get_context: get_context
returns the symbol_ids and signatures, get_symbol fetches the one
body you actually need. Two calls, zero file reads.
get_context
The workhorse tool. Compact, batched context for any set of files, modules, or symbols — docs, ownership, freshness, and optional source/callers/callees/metrics/community in one call.
search_codebase
Hybrid code search over repowise's indexes — symbols, file paths, or the wiki, depending on the shape of the query. One tool instead of a fallback to Grep for identifiers.