Skip to main content
Glama

Get code snippet

get_code_snippet
DestructiveIdempotent

Get source code for a function, class, or symbol using its qualified name. First, use search_graph to find the exact name, then retrieve the snippet.

Instructions

Read source code for a function/class/symbol. IMPORTANT: First call search_graph to find the exact qualified_name, then pass it here. This is a read tool, not a search tool. Accepts full qualified_name (exact match) or short function name (returns suggestions if ambiguous). If the response carries a 'coverage_note', the file was only partially indexed — constructs in the noted line ranges may be missing from the graph (best-effort signal); prefer grep there and treat the returned source as ground truth.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectYes
qualified_nameYesFull qualified_name from search_graph, or short function name
include_neighborsNo
Behavior1/5

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

Annotation contradiction: The description claims 'This is a read tool' (implying safe, non-destructive) while annotations set readOnlyHint=false and destructiveHint=true. This directly contradicts the description's behavioral claim.

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 compact yet dense, with the purpose front-loaded, followed by a critical workflow instruction and an important caveat. Every sentence earns its place without fluff.

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?

The description covers the main workflow, ambiguous-name handling, and the coverage_note partial-indexing signal. However, it omits details about include_neighbors behavior and return format, and the destructive annotation contradiction undermines completeness.

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?

Schema coverage is only 33%, but the description adds meaning for qualified_name by explaining it can be a full qualified name or short name and that ambiguity yields suggestions. However, it says nothing about project or include_neighbors, which are undocumented in the schema and require clarification.

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 'Read source code for a function/class/symbol' — a specific verb and resource. It explicitly distinguishes itself from search tools ('This is a read tool, not a search tool') and references the sibling workflow with search_graph.

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 usage instructions: 'First call search_graph to find the exact qualified_name, then pass it here.' Also gives when-not-to-use guidance ('not a search tool') and a fallback recommendation to use grep when coverage_note is present.

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/DeusData/codebase-memory-mcp'

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