save_from_html

save_from_html writes edited HTML back as a real document: DOCX, DOC, RTF, ODT, XLSX, XLS, ODS, CSV, PPTX, PPT, ODP, PDF, XPS, TXT, Markdown, MHTML, EPUB, MOBI, AZW3, EML or MSG. With sourceFile plus worksheet or slide, it splices the edited part into a copy of the original and keeps every other part. Example prompt: “Put the edited Q3 worksheet back into budget.xlsx.”

Tool description (as the AI agent sees it):

Saves edited HTML back as a real document: DOCX, DOC, RTF, ODT, XLSX, XLS, ODS, CSV, PPTX, PPT, ODP, PDF, XPS, TXT, Markdown (md), MHTML, EPUB, MOBI, AZW3, EML or MSG. Use it after extract_html when the user has edited the HTML, or to turn any HTML file in storage into a document. To put ONE edited worksheet or slide back into the original workbook or presentation (keeping every other part), pass the original as sourceFile together with the same 1-based worksheet or slide number (required for workbooks; a presentation sourceFile without slide gives a new one-slide presentation). PPTX and email targets always need sourceFile of the same kind. A resource folder named _resources next to the .html is picked up automatically. Returns the saved path (‘Saved to: …’). The output name is the HTML’s name with the new extension unless outputName is given; an existing file is never overwritten (a ’ (1)’ suffix is added). On failure isError is set and the text starts with ‘Save from HTML failed for’; a file that cannot be found returns the list of available files instead.

Parameters

NameTypeRequiredDescription
htmlFileobjectyesThe .html file to save, e.g. the file extract_html wrote — FileInput shape
formatstringyesTarget format extension: docx, xlsx, pptx, pdf, txt, md, epub, odt, rtf, csv, xps, mhtml, …
outputNamestringnoOutput file name (the extension is set from ‘format’). Default: the HTML’s name
passwordstringnoPassword-protect the output (Word, spreadsheet, presentation and PDF targets)
sourceFileobjectnoThe original document to splice the edited part back into (needed for PPTX and email targets) — FileInput shape
worksheetintegernoWith sourceFile: which worksheet the HTML replaces, 1-based
slideintegernoWith sourceFile: which slide the HTML replaces, 1-based
sourcePasswordstringnoPassword of sourceFile, if it is protected

Example call

{
  "name": "save_from_html",
  "arguments": {
    "htmlFile": {
      "filePath": "budget_worksheet2.html"
    },
    "format": "xlsx",
    "sourceFile": {
      "filePath": "budget.xlsx"
    },
    "worksheet": 2,
    "outputName": "budget-q3-revised.xlsx"
  }
}

Result

Plain text — captured from server 26.10.0 (evaluation line trimmed):

Saved 'budget_worksheet2.html' into a copy of 'budget.xlsx', replacing
worksheet 2 of 3 (XLSX)
Saved to: …/budget-q3-revised.xlsx

(Wrapped for width.) In that capture the edit changed two cells of the Q3 worksheet; the Summary and Q4 worksheets came back untouched. Unlicensed, the workbook also gained an Evaluation Warning worksheet and the banner line as the first row of the edited worksheet.

TargetNeeds sourceFile
DOCX, XLSX, PDF, TXT, Markdown, EPUB and the other document formatsno — HTML alone is enough
PPTX (and PPT, ODP), EML, MSGyes — the original carries what HTML cannot
one worksheet or slide back into the originalyes, with worksheet / slide

Without it, a presentation target fails with a reason:

Save from HTML failed for 'review_slide2.html' (-> pptx): 'pptx' output cannot be
created from HTML alone; pass the original document as 'sourceFile'.

password protects the output (Word, workbook, presentation, PDF); sourcePassword opens a protected sourceFile. On failure isError is set.

Example prompts

  • “Put the edited Q3 worksheet back into budget.xlsx.”
  • “Save my edited HTML as a Word document.”
  • “Replace slide 2 of the deck with the version I just edited.”

See it used end-to-end: Edit one worksheet or slide and put it back.