Documents AI and MCP Tools
The 22 ACL-aware Documents tools available through LeenOps AI and MCP.
The shared LeenOps registry exposes 22 Documents tools. The in-app assistant uses the signed-in user; hosted MCP uses the user who created the API key. Both paths apply current workspace membership, role permissions, and the document's own access rules.
Read tools
| Tool | Purpose |
|---|---|
list_workspace_documents | Search and filter readable documents. |
get_workspace_document | Retrieve document content and related metadata. |
list_document_types | List configured document types. |
list_document_versions | List immutable versions, newest first. |
list_documents_for_entity | Find readable documents linked to an entity. |
list_document_templates | Search reusable templates. |
get_document_template | Retrieve one reusable template. |
list_document_permissions | List explicit grants on a manageable document. |
Write tools
| Tool | Purpose |
|---|---|
create_workspace_document | Create a document and optional entity link. |
update_workspace_document | Save a new version with revision checking. |
archive_workspace_document | Archive a document. |
restore_workspace_document | Restore an archived document. |
restore_document_version | Restore historical content as a new version. |
add_document_link | Link a document to an entity. |
remove_document_link | Remove an entity link. |
create_document_template | Create a reusable template. |
update_document_template | Update a reusable template. |
clone_document_template | Clone a template. |
archive_document_template | Archive a template. |
restore_document_template | Restore a template. |
set_document_permission | Add or update a user/team grant. |
remove_document_permission | Remove an explicit grant. |
Permissions
| Permission | Capability |
|---|---|
documents.record.view | Read documents, types, versions, links, and templates. |
documents.record.create | Create documents. |
documents.record.edit | Save versions and manage entity links. |
documents.record.archive | Archive and restore records. |
documents.record.manage | Manage templates and explicit document grants. |
The REST scope presets are documents.read and documents.write. A write
scope includes the read permission. New API keys store the selected granular
permissions as well as their REST scopes.
Discover current schemas
curl "https://workspace.leenops.com/api/mcp/tools/list?features=documents&includeSchemas=true" \
-H "Authorization: Bearer $WORKESTRA_API_KEY"Example safe read:
{
"name": "list_workspace_documents",
"arguments": {
"search": "security policy",
"status": "active",
"limit": 20
}
}Example revision-controlled save:
{
"name": "update_workspace_document",
"arguments": {
"document_id": "document-uuid",
"expected_revision": 4,
"title": "Security policy",
"content_markdown": "# Security policy\n\nUpdated content",
"type_id": "document-type-uuid",
"access_mode": "restricted",
"change_summary": "Updated incident response section"
}
}If another editor has already saved revision 5, the update is rejected. Read the document again and resolve the conflict instead of retrying with a guessed revision.

