McpDocumentTools.h header

#include <ew/app/McpDocumentTools.h>

Namespace ew::app

Functions

void ew::app::registerMcpDocumentTools(McpServer &server, Workspace &workspace, McpChangeLog &log)

Registers the D4 documents/manuscript tool family on server (docs/MCP_SERVER.md §3): get_manuscript_tree, get_document, create_document, update_document, append_to_document, find_replace, get_document_versions, snapshot_document_version, and list_footnotes. Documents are addressed by title (case-insensitive, trimmed); an ambiguous title fails honestly listing each candidate's id, which every resolving tool accepts as an "id" argument to disambiguate. A document marked "Exclude from AI" is invisible to the reads and untouchable by the writes (the same guard act mode uses). Every mutating tool runs as one undo group and saves through runMcpMutation, appending its outcome to log. workspace and log must outlive server.