Skip to main content
Glama
ribhav-jain

docsonar

by ribhav-jain

read_file

Retrieve the full text of an indexed document, optionally within a start and end line, to inspect context around search hits.

Instructions

Read the text of one indexed document, optionally a line range.

Use after search to pull full context around a hit. path must lie inside a registered folder — anything else is refused (this server never reads outside registered folders). Plain-text formats (txt, md) return the raw file; binary formats (pdf, docx, html) return the extracted text, paragraphs separated by blank lines. start_line/end_line are 1-based and inclusive; omit both for the whole file. Output is capped at ~100k characters; truncated is true if the cap hit, in which case request a narrower line range.

Returns {ok, path, start_line, end_line, total_lines, truncated, text}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
end_lineNo
start_lineNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, the description fully carries the safety and behavior disclosure. It reveals that paths outside registered folders are refused, distinguishes plain-text vs binary extraction, explains 1-based inclusive line ranges, caps output at ~100k characters with a 'truncated' flag, and lists the return structure.

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?

The description is a single, well-organized paragraph with front-loaded purpose. Every sentence adds distinct value (usage, safety, format handling, parameters, output limits, return fields) with no filler or redundancy.

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 read_file tool with an output schema, the description covers the full workflow (after search), all parameter behaviors, format differences, output cap, and return shape. It is complete enough for an agent to invoke correctly without external documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% and the description compensates richly. It defines path constraints (must be in a registered folder), explains start_line/end_line as 1-based and inclusive, says to omit both for the whole file, and clarifies the truncation behavior for the line range.

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?

The description opens with 'Read the text of one indexed document, optionally a line range,' a specific verb plus object. It distinguishes from siblings by positioning the tool as the follow-up to search, pulling full context around a hit.

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?

The description explicitly states 'Use after search to pull full context around a hit,' giving a clear when-to-use. It does not explicitly enumerate when-not-to-use or name alternatives, but the positioning relative to search and the registered-folder constraint provide sufficient context.

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

Install Server

Other Tools

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/ribhav-jain/docsonar'

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