Skip to main content
Glama
jenkeeri
by jenkeeri

Read file from OpenGrok

opengrok_get_file
Read-onlyIdempotent

Read line-numbered source file content from an OpenGrok project using the full path returned by search. Use start_line and end_line to limit large files.

Instructions

Read a file's content (line-numbered) by the full path returned from search, e.g. "//dir/file.c". Use start_line/end_line for large files; output is cut at 30000 characters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
end_lineNoLast line (1-based, inclusive).
file_pathYesFull path as returned by search, starting with "/<project>/".
start_lineNoFirst line (1-based, inclusive).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered. The description adds real behavioral context beyond them: line-numbered output and a hard 30000-character truncation limit, which the agent needs to plan pagination. It doesn't cover error behavior on bad paths.

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?

Two tightly written sentences with the essential path-source constraint front-loaded and the pagination/truncation caveat second. Every clause carries information.

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?

With no output schema, the description must carry the return format, and it does: line-numbered content with a 30000-character cap. Complete enough to call correctly, with only error-handling and exact truncation semantics left implicit.

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 coverage is 100%, so the baseline is 3, but the description reinforces file_path's required format with an example and explains the purpose of start_line/end_line for large files, tying parameters to behavior rather than restating types.

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 a file's content') plus the key qualifier that the path must be the full path returned from search, which separates it from opengrok_find_file. It does not explicitly name the sibling tools, but the resource and path-source constraint make its role distinguishable.

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

Usage Guidelines4/5

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

Gives clear context for using start_line/end_line on large files and tells the agent where file_path comes from ('returned from search'). It stops short of an explicit when-not-to-use statement against opengrok_find_file or opengrok_search, but the routing guidance is strong.

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