Skip to main content
Glama

docshelf_read_document

Read-onlyIdempotent

Read a document from a shelf's docs/ directory, returning the file content. Supports paging large files with offset and max_bytes.

Instructions

Read a document or section file from inside the shelf's docs/.

Returns the file content directly over MCP — useful for private or purely-local shelves where the raw.githubusercontent.com fetch trick doesn't apply. Pass a relative_path from search / list_documents. Large files are truncated to max_bytes (default 100 KB) with truncated: true; page with the returned next_offset (slices snap to UTF-8 character boundaries, so it may differ from offset + max_bytes — using it avoids splitting a multibyte character) or read the individual split sections. Paths that escape docs/ are rejected.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

The annotations already declare readOnlyHint=true and destructiveHint=false (safe read-only). The description adds crucial behavioral details: truncation via max_bytes with truncated flag, paging using next_offset (with UTF-8 boundary explanation), and rejection of paths escaping docs/. No contradictions with annotations.

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 well-structured, starting with the core purpose, adding use-case context, then detailing parameters and behavior. It is slightly long (8 lines) but every sentence adds value. There is no wasted text, and the front-loading is effective.

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?

The description covers essential aspects: purpose, when to use, parameter guidance, security (path rejection), and paging behavior. Since an output schema exists (context signal), the description does not need to detail return values. The coverage is thorough given the tool's complexity.

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?

The input schema has descriptions for offset and max_bytes, but shelf_path lacks a description. The description adds significant value by explaining the paging mechanism, how next_offset works, and the role of max_bytes. This goes beyond the schema's information, but shelf_path remains undocumented.

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 clearly states 'Read a document or section file from inside the shelf's docs/.' This is a specific verb-resource combination that uniquely identifies the tool's purpose. It is immediately distinguished from sibling tools like docshelf_add_document (write) and docshelf_remove_document (delete).

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 explains when to use the tool: 'useful for private or purely-local shelves where the raw.githubusercontent.com fetch trick doesn't apply.' It also instructs to pass a relative_path from search/list_documents. However, it does not explicitly state when not to use this tool versus alternatives, though the use-case context is clear.

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/ignatenkofi/docshelf-mcp'

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