Skip to main content
Glama

read_symbol

Read-onlyIdempotent

Retrieve the body of a function or class by name from a file, limiting output to the requested symbol to reduce reading tokens.

Instructions

Body of one function/class by name.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>",
      "symbol": "<symbol>"
    },
    "name": "read_symbol"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFile
symbolYesName, case-insensitive, partial ok
maxLinesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

C2.9/5.0
Behavior3/5

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

The annotations already establish that this is a safe read-only, idempotent, closed-world operation, so the description need not repeat that. It adds that the result is the symbol's body rather than an outline or metadata, but it omits what happens on partial or ambiguous matches and does not mention maxLines truncation. This adds some useful behavioral context but leaves notable gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single front-loaded sentence with no filler or repetition. Its compactness is appropriate, though the fragmentary phrasing slightly reduces clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read tool it identifies the returned content, but with no output schema the description should disclose more operational context. It leaves out maxLines/truncation behavior, partial-match ambiguity handling, and when to prefer siblings such as read_slice or file_outline.

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 already documents path as a file and symbol as a case-insensitive partial name; the description's 'by name' largely restates the symbol parameter. The maxLines parameter has no description in either the schema or the tool description, so truncation semantics are undocumented despite 67% schema coverage.

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 operation and resource: returns the body of one function or class selected by name. The 'body of one symbol' framing helps distinguish it from outline or slice tools, but the description does not explicitly differentiate it from siblings such as file_outline or read_slice.

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

Usage Guidelines2/5

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

Usage is only implied by 'by name'; there is no explicit when-to-use, when-not-to-use, or alternative guidance. It does not say when to choose this over read_slice, file_outline, or search_compact, nor what to do if the symbol name is unknown or ambiguous.

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