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

ToolPurpose
list_workspace_documentsSearch and filter readable documents.
get_workspace_documentRetrieve document content and related metadata.
list_document_typesList configured document types.
list_document_versionsList immutable versions, newest first.
list_documents_for_entityFind readable documents linked to an entity.
list_document_templatesSearch reusable templates.
get_document_templateRetrieve one reusable template.
list_document_permissionsList explicit grants on a manageable document.

Write tools

ToolPurpose
create_workspace_documentCreate a document and optional entity link.
update_workspace_documentSave a new version with revision checking.
archive_workspace_documentArchive a document.
restore_workspace_documentRestore an archived document.
restore_document_versionRestore historical content as a new version.
add_document_linkLink a document to an entity.
remove_document_linkRemove an entity link.
create_document_templateCreate a reusable template.
update_document_templateUpdate a reusable template.
clone_document_templateClone a template.
archive_document_templateArchive a template.
restore_document_templateRestore a template.
set_document_permissionAdd or update a user/team grant.
remove_document_permissionRemove an explicit grant.

Permissions

PermissionCapability
documents.record.viewRead documents, types, versions, links, and templates.
documents.record.createCreate documents.
documents.record.editSave versions and manage entity links.
documents.record.archiveArchive and restore records.
documents.record.manageManage 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.