Skip to main content
Glama

read_code

Read numbered lines from a source file, research spec, or modding note, up to 300 per call, with a GitHub permalink to cite. Start a few lines above a hit for context.

Instructions

Read lines of a source file, research spec or modding note, numbered, with a GitHub permalink to cite. Up to 300 lines per call. Start a little above a hit for context. source: the one the path came from, as for find_symbol and search_code.

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>",
      "start": "<start>"
    },
    "name": "read_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNo
pathYes
startYes
sourceNod2moo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose useful behavior: a 300-line-per-call cap and permalink citation output. It says nothing about what happens when start exceeds file length, whether the range is clamped or errors, or permission requirements for reading arbitrary repo sources.

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?

Four short sentences, all front-loaded: purpose and output first, then the size limit, then the usage trick, then the parameter note. No filler or repetition.

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?

An output schema exists so return values need no explanation, and the description still notes numbering and permalink citation. For a simple 4-param read tool this is nearly complete; only edge-case behavior and end-line semantics are unaddressed.

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 coverage is 0%, so the description must compensate. It adds real meaning for 'source' (an enum of 15 repos) by explaining it must match the repo the path came from, and it clarifies 'start' as a context-window anchor and implicitly bounds start/end via the 300-line limit. 'path' and 'end' get no added explanation, leaving gaps.

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 and resource ('Read lines of a source file, research spec or modding note') and adds the output shape (numbered lines with a GitHub permalink). The 'start a little above a hit' phrasing implicitly separates it from the search tools, but it never names search_code or find_symbol directly.

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?

It hints at the workflow ('Start a little above a hit for context') and ties the source parameter to find_symbol and search_code, which gives an implied when-to-use. There is no explicit when-not guidance or statement of ordering prerequisites.

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