Skip to main content
Glama

get_symbol

Fetch source code for a specific function, class, or constant with verified line bounds, automatically handling ambiguous identifiers and missing index entries.

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.
    id: accepted alias for ``symbol_id`` — the tool table documents this
        tool as ``get_symbol(id)``, so ``id=`` is the natural call and is
        forgiven here rather than met with a hard argument error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNo
repoNo
queryNo
symbol_idNo
context_linesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, description fully discloses behavioral traits: candidates for ambiguous ids, truncation with continuation token, fallback_lines, verified vs approximate bounds. No contradictions.

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?

Information-dense but somewhat verbose. Front-loaded with main purpose, then details. Every sentence adds value, but could be slightly more compact.

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?

Given 5 parameters, no annotations, and no schema coverage, description is remarkably complete. Covers behavior, parameters, use cases, and return values despite output schema existing.

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?

Schema coverage is 0%, so description carries full burden. Explains symbol_id with examples, context_lines range, query for omission refs, id alias, repo omission. Adds significant meaning beyond schema.

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 uses specific verb 'Read' and resource 'symbol', and distinguishes from siblings by contrasting with Read+offset math.

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

Usage Guidelines5/5

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

Provides explicit when-to-use guidance: cheaper than Read+offset math, covers live range reads, omission refs, and fallback for index misses. Clearly states no follow-up needed when verified.

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