import_to_google_doc
Convert Markdown, DOCX, TXT, HTML, RTF, or ODT files into a new Google Doc, preserving formatting. Provide content directly, a local file path, or a remote URL to create the document.
Instructions
Imports a file (Markdown, DOCX, TXT, HTML, RTF, ODT) into Google Docs format with automatic conversion.
Google Drive automatically converts the source file to native Google Docs format, preserving formatting like headings, lists, bold, italic, etc.
Args: user_google_email (str): The user's Google email address. Required. file_name (str): The name for the new Google Doc (extension will be ignored). content (Optional[str]): Text content for text-based formats (MD, TXT, HTML). file_path (Optional[str]): Local file path for binary formats (DOCX, ODT). Supports file:// URLs. file_url (Optional[str]): Remote URL to fetch the file from (http/https). source_format (Optional[str]): Source format hint ('md', 'markdown', 'docx', 'txt', 'html', 'rtf', 'odt'). Auto-detected from file_name extension if not provided. folder_id (str): The ID of the parent folder. Defaults to 'root'.
Returns: str: Confirmation message with the new Google Doc link.
Examples: # Import markdown content directly import_to_google_doc(file_name="My Doc.md", content="# Title\n\nHello world")
# Import a local DOCX file
import_to_google_doc(file_name="Report", file_path="/path/to/report.docx")
# Import from URL
import_to_google_doc(file_name="Remote Doc", file_url="https://example.com/doc.md")Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | ||
| file_url | No | ||
| file_name | Yes | ||
| file_path | No | ||
| folder_id | No | root | |
| source_format | No | ||
| user_google_email | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |