get-drive-document-tool
Read one drive document — its metadata plus its body as Markdown or HTML.
Returns one document's metadata and its body. Use list-drive-documents-tool to find the id first.
Before reading, the tool drains any pending save on the collaboration server, so the body reflects what has actually been typed rather than a snapshot from a second or two ago.
The response carries a version token. Pass it back as expected_version when replacing the body, and the write is refused if anyone changed the document in between.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
document_id | integer | yes | The drive document id. |
format | string | no | markdown (default) or html. |
max_chars | integer | no | Maximum body characters to return, 500–200000, default 50000. |
offset | integer | no | Character offset into the body, for reading a long document in pieces. Default 0. |
Permissions
The caller needs drive access for the document's owner and at least view access to the document itself. A document the caller may not see and an id that never existed return an identical error, so this tool cannot be used to discover which documents exist.
Example
{
"document_id": 55
}Response
{
"id": 55,
"title": "Onboarding guide",
"kind": "document",
"source": "builtin",
"owner": { "type": "project", "id": 7, "name": "ACME website" },
"folder": { "id": 12, "name": "Drafts", "path": "Docs/Specs/Drafts" },
"url": "https://acme.plnnrly.com/projects/7?documentId=55",
"created_by": { "id": 28, "name": "Timo de Winter" },
"created_at": "2026-08-01T09:12:00+00:00",
"updated_at": "2026-08-19T15:40:11+00:00",
"access": "edit",
"tags": ["handbook"],
"collaborative": true,
"version": "9f2c41ab77e0d3b5",
"format": "markdown",
"content": "# Welcome\n\n- [x] Sign the contract\n- [ ] Book a desk\n",
"content_length": 812,
"truncated": false
}collaborative is true once the document has been opened in the editor. access tells you whether an update will be accepted. created_by is null for documents authored during an impersonated session.
What Markdown cannot carry
Markdown is the cheaper and more editable format, but the editor supports more than Markdown can express. These are lost when reading as Markdown:
- text colours and highlights
- text alignment, underline, subscript and superscript
- mathematical expressions and the table-of-contents block
- image sizing
- the identity behind an @mention — a mention of a person becomes plain text, and mentions of projects, customers and documents survive only as links
If a document may contain any of these and you intend to rewrite it, read it with format: "html" first. Appending never touches existing content, so it is safe either way.
Uploaded files
A PDF, image or Office document returns its metadata with "content": null and "unavailable_reason": "uploaded_file". This is a successful response, not an error — there is no body to read.
Errors
- A document the caller cannot see, or an id that does not exist, returns an authorization error.
- An out-of-range
max_charsreturns a validation error.