get_document
Retrieve the full text of a ranked search hit by its result number, using the same query, corpus, and page size to preserve ranking; page through long documents with offset and max_chars.
Instructions
Fetch the full text of one search hit, identified by its position in the result set.
result_number is the global 1-based rank of the document for this query —
the n field of a search_documents hit. Pass the same db, query, corpus and
page_size that produced it, or the ranking will not line up.
Long documents are returned in slices: raise offset by max_chars to page
through the body.
Args: db: Database title. result_number: 1-based rank of the document within the query's results. query: The same query string used in search_documents. corpus: The same corpus used in search_documents. target: "OPEN" or "USER". page_size: The same page_size used in search_documents. offset: Character offset into the document body. max_chars: Maximum characters of body text to return. include_raw_xml: Also return the untouched DocuXML content. owner_username: Owner of a friend-shared database, when applicable.
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": {
"db": "<db>",
"result_number": "<result_number>"
},
"name": "get_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| db | Yes | ||
| query | No | .all | |
| corpus | No | [ALL] | |
| offset | No | ||
| target | No | OPEN | |
| max_chars | No | ||
| page_size | No | ||
| result_number | Yes | ||
| owner_username | No | ||
| include_raw_xml | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |