Skip to main content
Glama

read_symbol

Retrieve source text of a specific function, class, or config key from a file without reading the entire file. Choose from full source, interface skeleton, or signature-only depth.

Instructions

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

depth controls how much is returned:

  • "full" (default): Entire source of the symbol. Typical savings: 10-20x fewer tokens than reading the whole file.

  • "interface": For a class -> header + field declarations + method signatures with bodies replaced by ' ...'. For a function -> just the signature.

  • "signature": Signature-only. For a function -> the line(s) before the body. For a class -> the class header.

Use this when: You need to read a specific symbol without reading the whole file. Pick the narrowest depth that contains what you need. Don't use this when: You need a structural overview of the whole file -> use list_symbols. You need to see the file's imports -> use read_imports.

Example: target="LRUCache.get" # full method source target="LRUCache", depth="interface" # class skeleton target="LRUCache.get", depth="signature" # just the def line target="project.version" # config value

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
targetYes
depthNofull

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations provided, so description carries burden. Declares read-only nature, explains depth behavior thoroughly, but lacks details on error handling or file path expectations. Still very good.

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?

Concise, well-structured with bullet points and examples. Information is front-loaded. Every sentence is informative and earns its place.

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?

Output schema exists so return values are covered. Description covers depth, usage, and examples. Could mention error handling or file path constraints, but overall quite complete for the tool's simplicity.

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 description coverage is 0%, so description must compensate. It provides extensive detail on depth parameter, and example usage for target. Could be more explicit about target format and file_path requirements, but adds significant value.

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 returns source text for a single named symbol, includes details on depth levels, and differentiates from sibling tools like list_symbols. The examples reinforce the purpose.

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?

Explicitly says when to use (need to read a specific symbol) and when not (structural overview -> list_symbols; imports -> read_imports). Also advises to pick narrowest depth.

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