Skip to Content
MosaicMosaicDocs
Tool Reference

EditDocument

Apply AI-driven edits to a Mosaic markdown document in place -- rewriting, inserting, formatting, or restructuring.

Starter documentation. Features and account details may differ from this deployment.

EditDocument

Apply AI-driven edits to a Mosaic markdown document in place -- rewriting, inserting, formatting, or restructuring. Use EditSpreadsheet for native Mosaic spreadsheets. Markdown documents only: these are authored in Mosaic's collaborative editor, and are the only documents whose content this tool can rewrite. Edit uploaded Word (.docx) files with ReadWordDocument and EditWordDocument instead. Other uploaded files -- PDFs, images, source files such as .py or .ts -- are readable but not editable, and are rejected. If the response contains a clarification field, invoke again with the requested info appended to instructions. To insert @-mention chips, include each referenced item's ids and details in instructions: userId/email for people; documentId/documentName/blockName (and blockParams when needed) for documents, channels, chats, projects, tasks, emails, calendar events, skills, calls, and routines; session id (and optional expanded card) for agent sessions; ISO datetime plus displayFormat for time chips; profileId/slug/url for booking links. To insert document-card(s), include each document's documentId and documentName; to embed a database, its databaseId, name, and tableId/viewId. To insert a live database answer or chart, quote the <m-db-query> block from SaveDatabaseQuery verbatim in instructions.

Parameters

ParameterTypeRequiredDescription
document_idstringYesThe ID of the markdown document to edit. If you are not certain the document is markdown, call ReadMetadata first and check that fileType is md -- passing an uploaded file here fails.
instructionsstringYesNatural language instructions. For @-mention chips, include each item's ids and details: userId/email for people; documentId/documentName/blockName for documents and similar items; session id for agent sessions; ISO datetime and displayFormat for time chips; profileId/slug/url for booking links. For document-card(s), include documentId and documentName per document. You may need to look these up.
fastbooleanNoSet true for one quick, contained edit -- rewrite this paragraph, translate the selected list, fix a heading, bold a phrase. A single model applies it directly in a few seconds. Leave false (the default) for anything with several parts or that restructures the document; the default pipeline plans, dispatches, and reviews its own work, which takes longer but is what multi-step edits need.

On this page