Skip to main content
Glama

read_symbol

Read the source code of a specific function, method, or class without loading the entire file. Supports Class.method syntax to target precise code sections.

Instructions

Read source code of ONE specific function/method/class — INSTEAD OF reading the whole file. Supports Class.method syntax.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path
symbolYesSymbol name, e.g. "UserService.updateUser"
context_beforeNoLines of context before (default: 2)
context_afterNoLines of context after (default: 0)
showNoDisplay mode: full (all lines), head (first 50), tail (last 30), outline (head + methods + tail). Default: auto (full ≤300 lines, outline >300)
include_edit_contextNoAppend raw code block for Edit old_string (saves a read_for_edit call)
session_idNoOptional Claude Code session_id for cross-restart dedup (see smart_read).
forceNoBypass dedup (see smart_read.force).
Behavior3/5

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

No annotations are provided, so the description must carry the burden. It describes the basic action (read source code) but does not disclose dedup behavior, error handling (e.g., symbol not found), or any side effects. The parameter descriptions in the schema hint at dedup features, but the description itself is silent on behavioral nuances.

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?

Two short, front-loaded sentences: first sentence states the core action and differentiates from whole-file reads; second sentence adds syntax support. Every word earns its place.

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

Completeness3/5

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

The description is minimal for a tool with 8 parameters. It does not explain return format, error scenarios, or how the dedup-related parameters (force, session_id) affect behavior. Given the lack of output schema, more context would be helpful.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds value by clarifying that the 'symbol' parameter supports Class.method syntax, which is not in the schema description. This extra context helps the agent use the parameter correctly.

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?

Description clearly states it reads source code of ONE specific symbol (function/method/class) and explicitly contrasts with reading the whole file. It also mentions support for Class.method syntax, making the tool's purpose unmistakable.

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?

The description explicitly says 'INSTEAD OF reading the whole file', guiding the agent to use this tool for targeted symbol retrieval rather than whole-file reads. It does not, however, mention when to use siblings like 'read_for_edit' or 'read_range', leaving some ambiguity.

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/Digital-Threads/token-pilot'

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