Skip to main content
The primary tool for managing documents and their lifecycle. Handles creation, metadata updates, branch operations, tag assignments, and commit history.

Parameters

ParameterTypeRequiredDescription
actionenumYesThe operation to perform (see actions below)
filesystemstringConditionalFilesystem slug — required for create when you have multiple filesystems
documentIdUUIDConditionalDocument UUID — required for most actions except create
pathstringConditionalDocument path — required for create
namestringNoDisplay name (default: last path segment)
descriptionstringNoDocument description
branchNamestringConditionalBranch name — see per-action requirements
sourceBranchstringNoSource branch for create_branch (defaults to default branch)
newPathstringNoNew path for update (renames/moves the document)
newDescriptionstring | nullNoNew description for update
tagIdUUIDConditionalTag UUID — required for assign_tag, remove_tag
tagPathstringConditionalTag path — required for create_tag
tagDescriptionstringNoDescription for create_tag
tagColorstringNoHex color for create_tag (e.g., "#3B82F6")
tagDisplayNamestringNoHuman-readable name for create_tag
commitIdUUIDConditionalCommit UUID — required for show and revert
limitintegerNoPagination limit for log
cursorstringNoPagination cursor for log

Actions

Document CRUD

ActiondocumentIdbranchNamepathNotes
createREQUIREDCreates on main; pass filesystem if you have multiple
updateREQUIREDREQUIREDnewPath to rename/move; newDescription to update description
deleteREQUIREDREQUIREDCannot delete on default branch
discardREQUIREDREQUIREDDiscard uncommitted working changes

Commit History

ActiondocumentIdcommitIdNotes
logREQUIREDList commits; accepts limit, cursor, optional branchName
showREQUIREDREQUIREDGet content at a specific commit
revertREQUIREDREQUIREDCreate new commit restoring a previous state; requires branchName

Branch Management

ActiondocumentIdbranchNamesourceBranchNotes
list_branchesREQUIREDList all branches
list_sectionsREQUIREDoptionalDefaults to document’s default branch
create_branchREQUIREDREQUIREDoptionalbranchName = new branch name
delete_branchREQUIREDREQUIREDCannot delete default branch

Tag Operations

Tag definitions are global to the tenant (not branch-scoped). Tag assignments are branch-scoped.
ActiondocumentIdbranchNametagIdtagPathNotes
list_tagsList all tags in tenant
create_tagREQUIREDAuto-creates ancestor tags
assign_tagREQUIREDREQUIREDREQUIREDAssign tag to document on branch
remove_tagREQUIREDREQUIREDREQUIREDRemove tag from document on branch

Examples

"Create a new document at /runbooks/incident-response"
→ documents({action: "create", path: "/runbooks/incident-response", name: "Incident Response"})

"Create a feature branch on the API guide"
→ documents({action: "create_branch", documentId: "...", branchName: "ai/add-auth-section"})

"See the commit history for this document"
→ documents({action: "log", documentId: "...", limit: 10})

"Move the doc from /old/path to /new/path"
→ documents({action: "update", documentId: "...", branchName: "main", newPath: "/new/path"})

"Assign the 'needs-review' tag to this document"
→ documents({action: "assign_tag", documentId: "...", branchName: "...", tagId: "..."})

Branch Workflow for AI

You can write directly to main for quick updates. For edits you’d like reviewed — or when multiple agents are working in parallel — create a feature branch and open a merge request so diffs are reviewable and experiments are discardable.
1. documents({action: "create_branch", documentId, branchName: "ai/my-update"})
2. sections({action: "update", documentId, branchName: "ai/my-update", ...})
3. merge_requests({action: "create", documentId, sourceBranch: "ai/my-update", targetBranch: "main", title: "..."})