The Docs Agent is OpenSwarm’s document engineer. It creates professional Word documents (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/UnkleFunk/HouseMusicSwarm-/llms.txt
Use this file to discover all available pages before exploring further.
.docx) and PDFs from HTML or Markdown content, edits existing documents with surgical search-and-replace precision, converts between formats, and maintains automatic version history for every DOCX export. HTML is used as the canonical source format because it gives the agent complete control over fonts, colors, tables, spacing, and layout — all of which survive conversion to DOCX and PDF with high fidelity.
Tools
CreateDocument
CreateDocument
Creates a new document from HTML or Markdown content.
- HTML workflow → produces a
.source.htmlfile (the canonical source of truth). Always auto-converts to.docximmediately after creation. - Markdown workflow → produces a
.mdfile only. No.docxor.pdfis generated from Markdown.
project_name— folder name under./mnt/(e.g.,"quarterly_reports")document_name— filename without extension (e.g.,"q3_executive_summary")content—{"type": "html", "value": "<!DOCTYPE html>..."}or{"type": "markdown", "value": "# Title\n..."}
ModifyDocument
ModifyDocument
Edits an existing document’s HTML source. Two modes:Line operations:
search_and_replace (preferred): provide a list of {old_content, new_content} pairs. Each old_content is matched exactly — like StrReplace. Batch all changes into a single call. The file is not modified if any replacement fails.replace, insert, or delete by line number — for structural additions or deletions where no existing content can be matched.ModifyDocument only updates the HTML source. Call ConvertDocument to re-export to DOCX or PDF after editing.ViewDocument
ViewDocument
Reads the current HTML source of a document. Always run this before editing to see the exact content and line numbers.Supports an optional
view_range parameter (e.g., [1, 50]) to show only a portion of a large document.ListDocuments
ListDocuments
Lists all documents in a project folder. Shows:
.source.htmlfiles (canonical source)- All DOCX exports including versioned files (
report.docx,report_v2.docx,report_v3.docx) - Whether each DOCX has a companion snapshot for version restore
- Other converted formats (PDF, Markdown, TXT) and their sizes
ConvertDocument
ConvertDocument
Converts the
.source.html to another format. Supported output formats:| Format | Notes |
|---|---|
docx | Word document. DOCX exports are automatically versioned — existing files are never overwritten; each export becomes report.docx, report_v2.docx, etc. A companion .snapshot.html is saved alongside every DOCX for version history. |
pdf | High-quality PDF rendered with WeasyPrint. Unicode normalization is applied automatically. |
markdown | Markdown, useful for documentation sites and wikis. |
txt | Plain text — all formatting stripped. |
RestoreDocument
RestoreDocument
Restores the working
.source.html to the state it was in at a previous DOCX export.Every ConvertDocument call that produces a .docx automatically saves a companion snapshot:RestoreDocument reads the named snapshot and writes it back as the canonical .source.html, ready for further edits or re-conversion. Use ListDocuments to see all available versions.Supported formats
| Format | Read | Write | Notes |
|---|---|---|---|
| HTML | ✅ (source input) | ✅ (.source.html) | Canonical source format; full CSS styling control |
| DOCX (Word) | — | ✅ | Auto-versioned; companion snapshot saved on every export |
| — | ✅ | High-quality via WeasyPrint; unicode normalization applied | |
| Markdown | ✅ (source input) | ✅ (.md) | Markdown workflow does not produce DOCX or PDF |
| TXT | — | ✅ | Plain text, all formatting stripped |
Output files
Every file the Docs Agent creates or exports is saved under./mnt/<project_name>/documents/ and the full path is included in the agent’s response. Use the path to open the file, share it, or hand it off to another agent.
CopyFile.