Skip to main content
Glama

get_symbol

Read-onlyIdempotent

Fetch a single function, class, or method by symbol ID or FQN and return only its source code. Avoids reading the whole file; can verify indexed source against git HEAD to detect stale data.

Instructions

Look up a symbol by symbol_id or FQN and return its source code. Use instead of Read when you need one specific function/class/method — returns only the symbol, not the whole file. For multiple symbols at once, prefer get_context_bundle. Read-only. Returns JSON: { symbol_id, name, kind, fqn, signature, file, line_start, line_end, source }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fqnYesThe fully qualified name to look up
max_linesNoTruncate source to this many lines (omit for full source)
symbol_idYesThe symbol_id to look up
verify_against_gitNoCompare the indexed source against the current git HEAD slice; mismatches set `git_mismatch: true` in the response (index may be stale). Read-only. Silently skipped when git is unavailable or the file is untracked.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changedv3.3.0
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • changedInput schema / properties / verify_against_git / description
      Previous value: -"When true, compare the indexed source against the current git HEAD slice for that file and line range. If they differ, the response includes `git_mismatch: true` indicating the index may be stale. Read-only — never writes. Silently skipped when git is unavailable or the file is not tracked."New value: +"Compare the indexed source against the current git HEAD slice; mismatches set `git_mismatch: true` in the response (index may be stale). Read-only. Silently skipped when git is unavailable or the file is untracked."
  2. Changed1 schema field changedv1.43.2
    • addedInput schema / properties / verify_against_git
      Added value: +{
      +  "description": "When true, compare the indexed source against the current git HEAD slice for that file and line range. If they differ, the response includes `git_mismatch: true` indicating the index may be stale. Read-only — never writes. Silently skipped when git is unavailable or the file is not tracked.",
      +  "type": "boolean"
      +}
  3. Added
  4. Removedv1.38.0
  5. Changed2 schema fields changedv1.35.1
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / required
      Added value: +[
      +  "symbol_id",
      +  "fqn"
      +]
  6. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already establish read-only/idempotent/non-destructive behavior. The description adds useful context by specifying that only the symbol is returned (not the whole file) and by enumerating the JSON response fields. It does not detail the git verification behavior, but that is disclosed in the schema.

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 carry the core purpose, usage routing, safety hint, and return shape with no filler. Key information is front-loaded.

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?

For a read-only 4-parameter tool without an output schema, the description gives a good overall contract: what is returned, which sibling to use, and that it is read-only. The only meaningful omission is resolving the symbol_id/FQN requirement conflict and noting the optional git mismatch behavior, though the latter is present in the input schema.

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

Parameters2/5

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

The schema covers 100% of parameters, so the baseline is 3; however, the description's 'by symbol_id or FQN' conflicts with the schema's required array listing both symbol_id and fqn. This can mislead an agent into supplying only one of them. The optional max_lines and verify_against_git behaviors are left entirely to the schema.

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 names a specific verb and resource ('look up a symbol ... return its source code') and immediately distinguishes itself from Read and get_context_bundle. An agent can infer exactly which operation this tool performs.

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 explicitly says when to prefer this over Read (one specific function/class/method) and when to prefer get_context_bundle instead (multiple symbols). No ambiguity remains about selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/nikolai-vysotskyi/trace-mcp'

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