Skip to main content
Glama

Surgical symbol snippet(s)

get_symbol_context

Retrieve the body of a function, class, or method with surrounding context lines, from one or multiple symbol names or a path+line, avoiding whole-file reads to save tokens.

Instructions

Return ONLY the body of a symbol (function/class/method) plus a few context lines — not the whole file. Give a name (resolved via the index), several names at once, or an explicit path+line. This is the biggest per-lookup token saver. When a skeleton showed you WHERE the functions are, pull their bodies with names:[...] here — do NOT fall back to reading the whole file for a handful of bodies.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lineNoDefinition line (use with path).
nameNoSymbol name to resolve via the index.
pathNoFile path (use with line instead of name).
afterNo
namesNoSeveral symbol names in one call — one bounded body each. The narrow alternative to a whole-file read.
beforeNo
maxLinesNoCap each returned span (default 200); tail elided with a notice.
pathPrefixNoRestrict name resolution to files under this prefix — disambiguates a duplicated name in ONE call.
Behavior4/5

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

No annotations are provided, so the description carries behavioral disclosure. It clearly states output scope (body + context lines, not whole file) and index-based name resolution. It omits edge-case behavior (e.g., not found, multiple matches beyond pathPrefix) but is notably transparent for a read-only tool.

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?

Three sentences, front-loaded with the core purpose and immediately useful guidance. Every sentence earns its place, including the explicit 'do NOT fall back' instruction.

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?

Given 8 parameters, no required fields, no output schema, and no annotations, the description covers main usage modes well. It explains how to request symbols and emphasizes token efficiency. It doesn't detail after/before defaults or maxLines cap, but schema provides those constraints.

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 covers 75% of parameters, and description adds meaning beyond it: clarifies name is index-resolved, names allows multiple bounded bodies, path+line is an explicit alternative. It doesn't fully explain after/before semantics, but those are inferable from 'context lines' and schema bounds.

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 states the tool returns the body of a symbol (function/class/method) plus a few context lines, explicitly excluding whole-file content. It clearly distinguishes this from broader file-reading tools and provides concrete usage patterns (name, names, path+line).

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?

It gives explicit when-to-use guidance: after a skeleton reveals function locations, pull bodies with names; advises against falling back to whole-file reads. It also mentions it's the biggest per-lookup token saver, helping the agent choose it over alternatives.

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/Siddhukaushik/slimdex-mcp'

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