Skip to main content
Glama

Linkly AI

read

Read-only

[Workflow: search → grep or outline → read] Read content of a document by its ID. Supports line-based pagination: use offset to start from a specific line number and limit to control how many lines to read. Returns content with line numbers.

Results include a "Referenced images in shown range" mapping that resolves markdown image refs to indexed image documents (doc_id + text excerpt); control detail with the optional image_text parameter ("none" / "abstract" / "full"). For image documents, pass include_image=true to receive the image itself as an image content block (resized, about 1,600 tokens); the text result always says whether an image is available. Images inside a scanned PDF appear as [Image p3-1]; pass image="p3-1" to see one (one image per call).

For long documents, prefer using outline or grep first to identify target sections, then read specific ranges.

Size fields (Desktop-local documents): word_count counts words (one per CJK character or Latin word; whitespace/punctuation/markup excluded) and reads well below a Chinese user's 字数; char_count counts Unicode characters of the extracted body (whitespace/punctuation/markup included, CR excluded) — the figure to match what the user sees. null/omitted char_count = not yet computed (or an older Desktop), not an empty body; read on a local document returns it whenever the Desktop supports it. cloud:// items do not carry char_count. Characters covers the whole available body, not just the returned lines, and is partial while OCR/ASR is pending or extraction was truncated.

For a Markdown clip that carries user annotations (highlights, notes and comments written in the clip reader), a "User annotations" block follows the content on the first content page (offset=1) or whenever annotations_offset is given; annotations page independently of the lines (20 per call, 20000-character budget) and the block reports total, has_more and next_annotations_offset. Pass limit=1 with annotations_offset to page annotations only.

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": {
      "doc_id": "<doc_id>"
    },
    "name": "read"
  }
}

Input Schema

NameRequiredDescriptionDefault
imageNoID of an image inside this document, as shown in its placeholders such as [Image p3-1] (page 3, first image). Returns only that image (resized, metadata stripped) and any text printed in it; offset and limit are ignored. Local documents only. null = omitted. Needs an up-to-date Desktop (an older one answers with an update notice); cloud:// documents keep no images and answer with a notice.
limitNoNumber of lines to read (default: 200, max: 500)
doc_idYesDocument ID (obtained from search results). Opaque string — pass through verbatim from `search`. Local documents take the form `local://<integer>`; bare integer IDs from older clients remain accepted. Cloud documents take the form `cloud://<owner>/<slug>/<root-hash>/<path>`.
offsetNoStarting line number (1-based, default: 1)
image_textNoDetail level for the referenced-images mapping appended to the result (markdown image refs found within the shown line range are resolved to indexed image documents): "none" = mapping only (line, file, doc_id); "abstract" (default) = plus one-line text excerpt and word count per image; "full" = plus inline OCR text (per-image 2000-char cap, 20000-char total budget; over-budget images degrade to abstract with a pointer to read them individually). Omitting or null yields "abstract". For local documents this requires an up-to-date Desktop (older Desktops reject the parameter with invalid_params; omit it for maximum compatibility). For cloud documents "full" inlining is not yet available: matched images degrade to abstract with a per-image pointer — read the image document itself for its full OCR text.
include_imageNoReturn the image itself as an MCP image content block in addition to the text. Only applies to image documents (png / jpeg / bmp / webp); defaults to false. The image is resized (long edge at most 1568 px, about 1.15 megapixels), re-encoded and stripped of metadata before it is returned, and is attached only on the first page (offset=1). Requires a client that accepts image results. Omitting or null means false. Needs an up-to-date Desktop (an older one answers with an update notice); cloud:// documents do not support it.
output_formatNoOutput format. Defaults to "markdown" (human-readable); set to "json" for structured JSON (machine-parseable). Sending `null` or omitting the field both yield the default.
annotations_offsetNoOffset into the document's user annotations (highlights, notes and comments written in the clip reader, stored next to the Markdown as `<stem>.annotations.json`), 0-based, default 0. Annotations are paged independently of the content lines: a "User annotations" block is appended after the content when `offset` is 1 (the first content page) or when this field is given explicitly, at most 20 annotations per call within a 20000-character budget; the block reports `total`, `has_more` and `next_annotations_offset`. To page through annotations only, pass `limit=1` to keep the content block minimal. Sending `null` or omitting the field both yield 0. Annotations exist only on the user's Desktop: cloud documents carry none, so omit this field for `cloud://` doc_ids (a non-zero value is rejected). Older Desktops reject the parameter with invalid_params; omit it for maximum compatibility.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Beyond readOnlyHint/openWorldHint, it discloses many non-obvious traits: results carry line numbers, images are resized to ~1,600 tokens and stripped of metadata, images attach only on the first page, annotation blocks page independently with a 20-item/20000-char budget, and cloud:// documents lose images and annotations. What keeps it from a 5 is that compatibility behavior (older Desktop rejecting params with invalid_params) is repeated in places and the relationship between error notices and normal output is only loosely described.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The first two paragraphs are well front-loaded and earn their space, but the description then expands into a long, dense block on word_count/char_count accounting and repeated 'needs an up-to-date Desktop' caveats that duplicate the schema and are tangential to invoking the tool. Structure is paragraph-based rather than scannable, making it heavier than the task requires.

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?

There is no output schema, yet the description explains the shape of results (line numbers, referenced-images mapping, user-annotations block with total/has_more/next_annotations_offset) and the size fields, including that partial char_count can mean not-yet-computed rather than empty. For an 8-parameter tool with cloud/local divergence and image handling, this covers what an agent needs to call it and interpret output correctly.

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 nevertheless adds cross-parameter meaning the schema does not state on its own — that `image` causes offset/limit to be ignored, that include_image only applies on offset=1, and that `limit=1` plus `annotations_offset` isolates annotation paging. That interaction-level detail is genuine added value over the per-field schema text.

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?

Opens with a specific verb+resource ("Read content of a document by its ID") and immediately frames it within a workflow (search → grep or outline → read), which distinguishes it from the listed siblings reflexively. It also states the scope precisely (line-based pagination, line-numbered output).

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?

Gives explicit when-to-use guidance: "For long documents, prefer using outline or grep first to identify target sections, then read specific ranges," naming concrete alternatives from the sibling set. It also covers the special paths (image documents via include_image, scanned-PDF images via image=, annotation paging via annotations_offset with limit=1).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources