Skip to main content
Glama

read_symbol

Retrieve a symbol's body and version from a codebase by symbol ID or file+name, auto-refreshing modified files for current context.

Instructions

MUST READ BEFORE WRITE. Symbol body + version (base_version for writes). Resolves by symbol_id or name+file. Full file? read_outline. AUTO-FRESH: files modified after last index are re-indexed automatically on read — explicit reindex only needed for brand-new workspaces/files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNocore (default): body+version. rich: +outline+navigation.
sourceNolive (default): current file+staleness. indexed: read-only snapshot, never for write.
locatorNoSymbol anchor: {symbol_id} or {file_path}+{name} (single read)
locatorsNoY002-S5 batch entry: array of locators, parallel read-only, per-entry failure non-blocking. Use instead of locator for multi-symbol reads.
budget_hintNoMax body chars to return; must truncate, not hint (default 1200)
on_ambiguousNofail (default): return candidates, never silently pick.
context_linesNoContext lines around symbol (default 0 — context_lines does not affect slicing; symbol body is returned as indexed)
outline_depthNoOutline depth (default 1)
workspace_dirYesREQUIRED: project root (abs). reindex first if new.
include_outlineNoForce include file outline (off in core by default)

Schema Changelog

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

  1. Changed1 schema field changedv0.4.5-post9
    • addedInput schema / properties / locator / description
      "Symbol anchor: {symbol_id} or {file_path}+{name} (single read)"
  2. First observed

TDQS

A4.7/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses auto-fresh re-indexing behavior, resolution modes (symbol_id or name+file), and base_version relevance for writes. However, it does not describe error handling or the exact return payload beyond 'body + version', preventing a 5.

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 dense sentences, each earning its place: prerequisite, core function, and alternatives/auto-fresh. No fluff or redundancy, well front-loaded.

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?

For a 10-parameter tool with no output schema, the description covers the key decisions: what it reads, how to resolve symbols, when to use read_outline, and reindex behavior. The schema details the rest, so the description is complete enough for an agent to select and invoke the tool correctly.

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 100%, so baseline is 3. The description adds value by explaining resolution via symbol_id or name+file, and mentions base_version for writes, which is not in the schema. This raises it to a 4.

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?

Description clearly states it reads symbol body and version, resolves by symbol_id or name+file, and explicitly distinguishes from read_outline for full files. The verb 'read' is explicit and the resource is a symbol, with sibling differentiation.

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 'MUST READ BEFORE WRITE', provides an alternative ('Full file? read_outline'), and clarifies when reindexing is needed (brand-new workspaces/files). This gives clear when-to-use and when-not-to-use guidance.

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/wulun811/LiuHe'

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