Skip to main content
Glama

read_symbol

Get the source body of a named function, method, or type in one call. Handles ambiguous names by returning all matches and falls back to static parsing when the language server is unavailable.

Instructions

Read the source body of a named symbol (function, method, type) in one call. Accepts plain name or dotted ReceiverType.MethodName form. Returns all matches when the name is ambiguous. Each body line carries a display-only 1-based file line-number gutter ('\t', cat -n style) — strip it before reusing a line as an edit_file old_string. Falls back to a tree-sitter parse when the language server is cold or absent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uriNoAlias for path (absolute path, file:// URI, or workspace-relative path). Used only when path is omitted.
nameNoExact symbol name. Accepts plain name (e.g. "handleConn") or dotted ReceiverType.MethodName form (e.g. "Model.renderDashboard").
pathNoAbsolute path, file:// URI, or workspace-relative path of the file containing the symbol
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It discloses ambiguity handling ('Returns all matches when the name is ambiguous'), the line-number gutter caveat with specific stripping instruction for edit_file reuse, and the tree-sitter fallback when the language server is cold or absent. This goes well beyond basic read semantics, though error cases like symbol-not-found are not explicitly mentioned.

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

Conciseness5/5

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

The description is four sentences long and front-loaded with the core action. Each sentence adds distinct value: the action, accepted input forms, ambiguity behavior, output format caveat, and fallback mechanism. There is no fluff or redundancy.

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

Completeness4/5

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

For a read tool with no annotations or output schema, the description sufficiently covers return behavior (all matches), ambiguity handling, output line-number gutter instructions, and language-server fallback. The only minor gap is the absence of a symbol-not-found behavior note, but overall it is adequately complete.

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

Parameters3/5

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

The input schema already provides 100% coverage for all three parameters, so the baseline is 3. The description echoes the dotted-name form present in the schema but adds no new parameter-level nuance; it focuses on output formatting and fallback behavior rather than parameter meanings.

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 opens with a specific action: 'Read the source body of a named symbol (function, method, type) in one call,' clearly identifying the resource and scope. It distinguishes itself from siblings like get_definition and read_file by focusing on the symbol body retrieval rather than definition location or whole-file content.

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

Usage Guidelines3/5

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

The description implies usage through phrases like 'in one call' and accepts plain or dotted forms, but it does not explicitly state when to prefer this tool over alternatives such as get_definition or search_in_files. No exclusions or direct comparison to siblings are provided, leaving the agent to infer the appropriate context.

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/plumbkit/plumb'

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