Skip to main content
Reads the exact text of a document in a document collection, page by page, and checks quotes against it. Display name “Read Document”. Agents use it to read around a search hit before answering, and to confirm that every quote they cite really is on the page they cite.

Authentication and enablement

  • No integration needed.
  • Off by default. Add it to an agent’s tools.
  • The workspace must have document collections switched on (runtime flag document_collections.enabled).

Inputs

Give either file_id or chunk_id.
  • file_id: the document’s file_id, as returned by retrieve_documents or list_documents.
  • pages (optional): a page ("3") or a range ("3-5"). Default "1". At most 5 pages per call.
  • chunk_id (optional): a passage returned by retrieve_documents. Add neighbours (0–3) to include that many passages on either side.
  • quotes (optional): phrases you plan to cite, at most 20 per call and 1,000 characters each. Each one is checked against the returned text.

Output

  • The page text, each page marked [page N].
  • When pages were cut at five, a note saying which range to ask for next.
  • For each quote, whether it was verified and the page it is on, plus a view_path link that opens that page in the app with the quote highlighted. A quote counts as verified when it appears on the page, ignoring case, punctuation, quote styles and line breaks, with a few OCR-garbled words allowed. Numbers (amounts, dates, ages) and negations such as “not” must match exactly. A quote shortened with ”…” verifies when each part does, in order. A rebuilt table or form row whose numbers and words are on the page, but not in that order, is reported as approximate: cite the page and its values, not the wording.

Limits and side effects

  • Read-only.
  • Returns only documents this agent can see: any collection in the workspace, its own library documents and documents shared with the whole workspace. Never another agent’s private library.

Expected errors

  • Document collections not enabled.
  • Document or passage not found. This is also the answer for documents the agent cannot see.
  • More than 20 quotes, or a quote over 1,000 characters: split them across calls.
  • pages not written as "3" or "3-5".