Get document content
get_document_contentRead a document's OCR text in character-limited slices and pass offsets to continue through long content; search full text first to locate needed passages.
Instructions
Read the OCR text of a document in slices of max_chars characters (default 20000).
total_chars is the length of the whole text; while next_offset is set, pass it as offset to read on. An offset past the end returns an empty slice with total_chars. Prefer search_documents with a full-text query to find the passage you need first.
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_id": "<document_id>"
},
"name": "get_document_content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offset | No | Character offset to start at. | |
| max_chars | No | Characters to return, at most 20000. | |
| document_id | Yes | Document id, from search_documents. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offset | Yes | Where the slice starts, in characters. | |
| content | Yes | ||
| web_url | Yes | Link to the document in the Paperless web UI. | |
| document_id | Yes | ||
| next_offset | Yes | Offset of the next slice, null at the end of the text. | |
| total_chars | Yes | Length of the whole text. |