Skip to main content
Glama
denzharkov

codegraph-mcp

by denzharkov

read_symbol

Retrieve the full source code of one function, class, or method by name without opening the entire file, reducing token usage.

Instructions

Full source of ONE symbol (function/class/method) without reading the whole file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoRepo-relative file path to disambiguate
nameNoSymbol name (exact, case-insensitive)
indexNo1-based pick when several matches exist

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.17.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description must carry the behavioral load. It discloses the return content (full source) and the read-only nature implied by 'read', but says nothing about behavior when a symbol isn't found, when multiple matches exist beyond the index hint, or handling of binary/generated files.

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?

A single front-loaded sentence that states the core value proposition (one symbol's full source) with the key contrast (no whole-file read). No filler.

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 single-symbol extractor with fully documented parameters and no output schema, the definition covers what the tool returns and its efficiency benefit. Minor gaps remain around multi-match resolution and not-found behavior, but nothing critical for correct invocation.

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 description coverage is 100%, so each of the three parameters (file, name, index) is already documented in the schema. The description adds no additional parameter semantics, so the baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (read) and resource (ONE symbol: function/class/method) and clarifies it returns full source without loading the whole file. This is clear, but it doesn't differentiate from the closely related sibling find_symbol or file_skeleton, so an agent could confuse the two.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied by the phrase 'without reading the whole file', which suggests using this instead of a full file read. There is no explicit guidance on when to choose this over find_symbol, file_skeleton, or semantic_search, and no stated prerequisites.

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