Skip to main content
Glama

read_symbol

Extract source code for specific functions, classes, or config keys from files without loading entire documents, reducing token usage by 10-20x for focused code analysis.

Instructions

Return the full source text of a single named symbol (function, class, method, config key) without reading the entire file. Read-only.

Use this when: You need to see the implementation of ONE specific function or class. Far cheaper than reading the whole file -- typically 10-20x fewer tokens. Don't use this when: You need a structural overview of the file -> use list_symbols. You only need the signature -> use get_signature.

Example: target="LRUCache.get" # returns just the get method's source target="LRUCache" # returns the entire class source target="project.version" # returns the value node for a config key

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
targetYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
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 effectively communicates key traits: it's 'Read-only' (safety), 'cheaper than reading the whole file' (performance), and returns 'full source text' (output behavior). It also clarifies scope with examples (e.g., returning just a method vs. entire class). However, it doesn't mention error handling or permissions, leaving minor gaps.

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 front-loaded with the core purpose, followed by usage guidelines and examples. Every sentence earns its place: the first states what it does, the second provides usage rules, and the third gives practical examples. It's appropriately sized with zero wasted text, making it easy to scan and understand.

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 the tool's moderate complexity (2 parameters, no annotations, but with an output schema), the description is complete enough. It covers purpose, usage, behavioral traits, and parameter semantics thoroughly. Since an output schema exists, it doesn't need to explain return values, and the examples bridge any remaining gaps, making it self-sufficient for an agent.

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?

The schema description coverage is 0%, so the description must compensate fully. It does so by explaining the 'target' parameter with concrete examples (e.g., 'LRUCache.get', 'project.version'), clarifying what it represents and how it's used. This adds significant meaning beyond the bare schema, making parameter usage clear and actionable.

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 the tool's purpose with specific verbs ('Return the full source text') and resources ('single named symbol'), distinguishing it from siblings like 'list_symbols' and 'get_signature'. It explicitly mentions what it does not do (read the entire file), making its scope unambiguous.

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?

The description provides explicit guidance on when to use ('when you need to see the implementation of ONE specific function or class') and when not to use ('Don't use this when: You need a structural overview -> use `list_symbols`. You only need the signature -> use `get_signature`'). It names alternatives and includes a cost comparison ('10-20x fewer tokens'), offering comprehensive usage 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/kambleakash0/agent-skills'

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