Overview
Theget tool retrieves the full content of a document by its file path or docid. Use paths or docids from search results to fetch complete documents.
Input Schema
File path, docid, or path with line number suffixFormats:
pages/meeting.md— Relative file path#abc123— Docid from search results (# prefix optional)pages/meeting.md:100— Path with line offset
Start reading from this line number (1-indexed). Overrides
:line suffix in file.Maximum number of lines to return. Truncates long documents.
Add line numbers to output (format:
N: content)Response Format
Success
Array with a single resource object
Error
Array with a single text element
Always
true for errorsExamples
Retrieve by Path
Request:Retrieve by Docid
Request:<!-- Context: ... --> prefix from qmd context add.
Start at Specific Line
Request:With Line Numbers
Request:Truncate Long Documents
Request:File Not Found
Request:Path Resolution
The tool tries multiple strategies to find documents:- Exact match —
collection+path - Suffix match — If exact match fails, finds paths ending with the query
- Docid lookup — If
filestarts with#, treats it as a docid
Context Metadata
If you’ve added context withqmd context add, it appears as a comment at the top:
CLI Equivalent
--line-numbers for numbered output.
Related Tools
multi_get Tool
Retrieve multiple documents by glob pattern
query Tool
Search to find document paths and docids
Context
Add context metadata with qmd context