Skip to main content
Glama
Linkly AI

Linkly AI

Official

read

Read-only

Fetch document content by ID from Linkly AI with line-based pagination to inspect specific sections, referenced images, and user annotations.

Instructions

[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.
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.
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".
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.
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true, but the description goes far beyond: defaults (200 lines, offset 1-based), image resizing to ~1,600 tokens with metadata stripped and attachment only on offset=1, annotation paging caps (20 per call, 20000-char budget), and the important caveat that char_count can be partial while OCR/ASR is pending or extraction was truncated.

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 workflow tag and the opening read/pagination sentence are well front-loaded, but the final paragraph on annotations paging nearly duplicates the annotations_offset schema text, and the size-fields paragraph is dense enough to slow scanning. It is informative rather than wasteful, yet it could be trimmed substantially without losing callable information.

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 an 8-parameter read tool with no output schema, the description covers everything an agent needs: return shape (content with line numbers, referenced-images mapping, User annotations block), pagination model, image handling, and the semantic distinction between word_count and char_count. Nothing material is missing.

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, and the description earns an extra point by adding cross-parameter behavior the schema only partially conveys — offset=1 triggers the annotations block, image ignores offset/limit, and limit=1 minimizes the content block during annotation paging. It loses a point for largely restating the image_text detail levels and annotations_offset semantics already spelled out in the schema.

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 situates it in a workflow ("search → grep or outline → read"), which tells an agent exactly how this differs from grep/outline/search without opening a schema.

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 routing guidance: "For long documents, prefer using outline or grep first to identify target sections, then read specific ranges." It also states when to use the alternate modes (image="p3-1" for scanned-PDF images, include_image=true for image documents, limit=1 with annotations_offset to page annotations only).

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