get_doc
Read a document's outline and metadata by default, then request a single section or the full body; use version checks before editing.
Instructions
Read a document. By DEFAULT returns metadata plus the outline (headings) and NOT the body — a document is far larger than a task, and a body you read stays in your context for the rest of the session. Read the outline first, then pass section="" for just that part; body=true returns the whole page and should be the exception. The returned version is what update_doc takes as base_version. If you addressed the document by an old path or a bare slug, the reply carries moved_to (its current path); a bare slug shared by several documents fails with 409 and the list of full paths.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc | Yes | Document UUID, or a slug path like 'architecture/adr/adr-004' (a path also needs project_id). A path survives the document being moved: the old path still resolves, and so does a bare slug ('adr-004') when exactly one live document in the project has it. When the reference was not the live path, the reply carries moved_to — the document's current path; use that from now on. A bare slug shared by several documents is a 409 ('Ambiguous document slug') listing the full paths: pick one and repeat the call with the full path or the UUID. The UUID never changes. | |
| body | No | Return the full markdown body. Prefer section= when you need one part. | |
| section | No | Return only this section: a heading's text, or its anchor from the outline. | |
| project_id | No | Project UUID. Required only when doc is a slug path. | |
| version_only | No | Return just the version — the cheap 'has this changed since I read it?' check before a write. | |
| outline_depth | No | Limit the outline to headings at this level or shallower (e.g. '2' for chapters, not every subsection). Default: all levels. |