Skip to main content
Glama

read_document

Retrieve a document or task by ID or path, optionally limited to a startLine/endLine range, including library section files. Use it to inspect content before editing or answering questions.

Instructions

Read a specific document or task. Works with both regular documents and tasks from tasklists (tasks are markdown documents). Also reads library section files by path (documents///sections/.md or a doc:…#s-… citation) — but for library questions prefer search_library + get_library_section, and never read a whole volume. For large documents pass startLine/endLine; the response includes totalLines.

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": {
      "workspace": "<workspace>",
      "documentId": "<documentId>"
    },
    "name": "read_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
endLineNoLast line to return (1-based, inclusive). Omit to read to the end.
startLineNoFirst line to return (1-based, inclusive). Omit to start from the beginning.
workspaceYesWorkspace path/name
documentIdYesDocument ID, path from registry, task path (e.g., "documents/Mobile Tasks/Core/task-name.md"), or a library section file path

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.19.0
    • changedInput schema / properties / documentId / description
      Previous value: -"Document ID, path from registry, or task path (e.g., \"documents/Mobile Tasks/Core/task-name.md\")"New value: +"Document ID, path from registry, task path (e.g., \"documents/Mobile Tasks/Core/task-name.md\"), or a library section file path"
    • addedInput schema / properties / endLine
      Added value: +{
      +  "description": "Last line to return (1-based, inclusive). Omit to read to the end.",
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / startLine
      Added value: +{
      +  "description": "First line to return (1-based, inclusive). Omit to start from the beginning.",
      +  "minimum": 1,
      +  "type": "integer"
      +}
  2. First observedv0.6.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the burden and discloses useful behavior: tasks are markdown documents, library sections have specific path forms, large reads should be line-scoped, and the response includes totalLines. It does not mention permissions or full response shape, but it covers the important behavioral constraints for a read operation.

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 front-loaded and dense: it states the core action, supported targets, preferred alternatives, and line-range guidance without filler. Every sentence contributes operational guidance.

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?

For a four-parameter read tool with no annotations and no output schema, the definition is largely complete: it explains target types, path formats, volume avoidance, line scoping, and that totalLines is returned. It could say more about the returned content beyond totalLines, but the essential call guidance is present.

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. The description adds practical meaning beyond the schema by explaining why startLine/endLine matter for large documents and by enumerating valid documentId forms including task paths and library section citations.

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 gives a specific verb and resource, then enumerates the supported targets: regular documents, tasks from tasklists, and library section files by path or citation. It also distinguishes the tool from library-oriented siblings by naming search_library and get_library_section.

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

Usage Guidelines5/5

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

It explicitly says when to prefer alternatives for library questions and when not to use this tool by warning 'never read a whole volume.' It also gives concrete guidance to pass startLine/endLine for large documents.

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