Get document text
get-document-textReads a document's plain text in character-based chunks.
Use this tool when:
You need to read a full document (e.g., to summarize, review, or compare wording).
You want to read more context around a match found by search-document-text.
For a specific clause or term, call search-document-text first—it is much cheaper than reading the whole document. Then pass an offset slightly before the match (e.g., 1,000 characters earlier, or 0 if the match is nearer the start) and a max_chars of a few thousand.
Works for all documents: authored in fynk, signed, or uploaded as a PDF, whose text comes from OCR with one line per paragraph.
Chunking & pagination:
Chunks are character slices and do not correspond to printed or PDF pages. Never cite page numbers; quote the passage or name its clause instead.
Each response includes total_chars, the returned range (offset to end_offset), and next_offset if more text remains. Pass next_offset as offset to continue.
Chunks break at paragraph or word boundaries, so a response may be shorter than max_chars.
Check total_chars on the first chunk before paging through the rest; only read an entire document when the task requires it.
Consistency & errors:
When paging or following up on search-document-text, pass the previous text_hash. If the document changed in between, the call fails instead of returning mismatched text; start again without text_hash: search again if the offset came from a search, otherwise read from offset 0.
If there is no text to read yet (text recognition of a PDF still running, or a new document's text not yet prepared) or none at all (password-protected PDF, unreadable scan), the call fails with a message giving the cause and whether retrying later can help.
The text follows an edit within a few seconds, so right after changing a document it may still show the previous wording.
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": {
"document_uuid": "<document_uuid>"
},
"name": "get-document-text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offset | No | Character offset to start reading at: 0 for the start, next_offset from a previous chunk, or an offset near a match from search-document-text. | |
| max_chars | No | Maximum characters to return (may return fewer to end on a paragraph or word boundary). | |
| text_hash | No | The text_hash from a previous get-document-text or search-document-text response. Fails if the document's text has changed since. | |
| document_uuid | Yes | UUID of the document to read. If you don't have it, call list-documents to find it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | The text of this chunk. | |
| offset | No | The character offset this chunk starts at. | |
| text_hash | No | Identifies the version of the text this chunk came from. Pass it back when reading on. | |
| end_offset | No | The character offset this chunk ends at (exclusive). | |
| next_offset | No | The offset to read the next chunk from. Absent when this chunk reaches the end of the text. | |
| total_chars | No | The length of the document's whole text, in characters. |