Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
repoNo
queryNo
symbol_idYes
context_linesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses all key behaviors: bounds checking (verified vs approximate), ambiguous IDs returning candidates, live range reads, omission refs, index miss grep, truncation with continuation token. No annotations provided, so description carries full burden and delivers.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with core purpose in first sentence. Subsequent details are valuable and well-organized. Slightly verbose but every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers input semantics, behavioral traits, and return behavior (candidates, continuation) comprehensively. With output schema present, description sufficiently equips agent for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Adds significant meaning beyond schema: explains symbol_id format (path::Name, path:range, omission ref), context_lines range (0-50), repo usually omitted, query for omission refs only. Schema had 0% description coverage, so this is essential and well-provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it reads one function/class/constant with live-verified line bounds. It distinguishes itself from sibling tools (e.g., get_context for navigation) and specifies various use cases like live range reads and omission refs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance on when to use: for reading symbols with verified bounds, cheaper than Read+offset math. Explains handling of ambiguous IDs and fallback behavior. Lacks explicit comparison to alternatives but context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/repowise-dev/repowise'

If you have feedback or need assistance with the MCP directory API, please join our Discord server