export_research_session
Export completed research sessions to Word, Markdown, or JSON files. Recover reports after deep research runs or convert them into shareable documents.
Instructions
Save (export, download, archive) a completed research session to a file
on disk — Word (.docx), Markdown (.md), or JSON. Use this to recover
your report after a research_deep run completes or is interrupted,
and to convert reports into a shareable Word document.
Disk-first contract. The file is always written to disk, and the
absolute path is returned on the first line of the response as
Saved to: <path>. When output_path is omitted the file lands in
GEMINI_RESEARCH_EXPORT_DIR (default ~/.gemini-research/exports/).
An EmbeddedResource is still attached so GUI hosts can expose their
native "Save As" affordance.
Similar to Google's Deep Research export feature, the DOCX output is a professional Word document suitable for sharing, archiving, or further editing.
Supported formats:
docx: Word document with headings, lists, and table of contents
markdown: Clean
.mdfile with full report and citationsjson: Machine-readable, all metadata preserved
Typical recovery flow:
research_deep(...)completes (or is resumed viaresume_research).export_research_session(format="docx")— no other arguments needed; the path on disk is returned in the response text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Optional: search for a session by query text instead of interaction_id | |
| format | No | Export format: 'markdown' (.md), 'json' (.json), or 'docx' (Word document) | markdown |
| output_path | No | Filesystem path to save the exported file to. Absolute or relative to the MCP server's working directory. If omitted, the file is automatically written to GEMINI_RESEARCH_EXPORT_DIR (default ~/.gemini-research/exports/) and the resolved path is returned in the response. Parent directory must already exist when an explicit path is supplied. | |
| interaction_id | No | Interaction ID of the session to export. If not provided, exports the most recent. |