Skip to main content

Document Generation

Agents can create documents during conversations using the generate_document MCP tool. This enables agents to produce reports, presentations, spreadsheets, meeting notes, and more -- all formatted as downloadable files.

Supported Formats

FormatExtensionBest For
PowerPoint.pptxPresentations, pitch decks, status updates
Word.docxReports, proposals, meeting notes
Excel.xlsxData exports, financial reports, dashboards
PDF.pdfFormal documents
Markdown.mdTechnical docs, READMEs, specs
Plain Text.txtLogs, raw exports, simple notes

How It Works

  1. A user asks an agent to create a document (e.g., "Create a Q4 sales report")
  2. The agent uses the generate_document tool with structured content
  3. MeetLoyd generates the file and stores it as a persistent attachment
  4. The agent replies with a download link, rendered as an artifact card in chat

Example Flow

User: "Create a presentation about our Q4 results"

Agent uses generate_document with format, filename, title, and slide content.

Agent: "Here's your Q4 results presentation:" followed by an artifact card with the file name, format label, and a download button.

Artifact Cards

When an agent sends a message containing a file download URL, the chat renders it as a styled artifact card:

  • Format-specific icon and color (red for PDF, blue for DOCX, green for XLSX, orange for PPTX)
  • File name displayed prominently
  • File format label and size
  • One-click download

This works for both agent-generated documents and user-uploaded files.

Use Cases

Use CaseFormatExample
Meeting notesDOCXAgent summarizes a team conversation into structured notes
Status presentationsPPTXWeekly status deck auto-generated from project data
Data exportsXLSXAgent pulls CRM data and creates a filtered spreadsheet
Compliance reportsPDFAudit report generated from governance pack data
Technical specsMDAgent drafts a spec based on conversation requirements
Executive summariesDOCXAgent distills a long thread into a one-page brief

Persistence

Generated documents are stored durably, tied to the tenant and agent that created them. Files survive server restarts and deployments -- download links remain valid.

Content Structure by Format

PowerPoint (PPTX)

Slides support multiple layouts: title, content, section, two-column, and blank. Each slide can have a title, bullet points, and speaker notes. The agent structures its content as a list of slides with layout hints.

Word (DOCX)

Documents use a section-based structure. Each section can include headings (levels 1-4), paragraphs, bullet lists, and tables with headers and rows.

Excel (XLSX)

Workbooks contain one or more sheets. Each sheet has headers, rows of data, and optional column width settings. Multi-sheet workbooks are useful for summary + detail patterns.

Markdown and Plain Text

For simpler formats, the agent provides a title and the raw text content. Markdown supports the full syntax (headings, lists, tables, code blocks).

Combining with File Uploads

Agents can read uploaded files and use them as input for document generation. For example, a user uploads a CSV and asks the agent to "turn this into a formatted Excel report." The agent reads the CSV, structures the data, and generates a polished XLSX.

Best Practices

Be Specific in Prompts

The more detail you give, the better the document. "Create a PPTX with 5 slides covering Q4 revenue, key wins, top customers, challenges, and 2026 outlook" produces much better results than "Make a presentation about Q4."

Let Agents Choose the Format

Include format guidance in agent system prompts so agents pick the right format automatically. PPTX for presentations, DOCX for reports, XLSX for data tables.

Combine with File Uploads

Upload raw data files and ask agents to transform them into formatted documents. The agent reads the input, processes it, and generates polished output.


Related: Files & Attachments for upload and file management details.