Skip to main content
Glama

write_document

Write content to document files in HTML, Markdown, plain text, or DOCX formats. Automatically saves files with intelligent format detection and organized naming.

Instructions

Write content to document files in specified formats. Output directory is controlled by OUTPUT_DIR environment variable. Files will be automatically saved to OUTPUT_DIR with auto-generated names based on content type (HTML, Markdown, or plain text). Supports intelligent format detection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesContent to write
encodingNoFile encodingutf-8
titleNoDocument title (optional, used for filename generation)
formatNoForce specific format: html, md, txt, docx (optional, auto-detected if not specified)

Implementation Reference

  • Helper mapping in ConversionPlanner that associates converting from TXT format to HTML, Markdown, MD, DOCX, or PDF with the 'write_document' tool name. This is the only reference to the tool in the codebase, suggesting it may be planned or external.
    txt: {
      html: 'write_document',
      markdown: 'write_document',
      md: 'write_document',
      docx: 'write_document',
      pdf: 'write_document',
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals that files are automatically saved to OUTPUT_DIR with auto-generated names and supports format detection, which is helpful. However, it lacks critical details: it doesn't specify whether this is a write-only operation (no read-back), what happens if OUTPUT_DIR doesn't exist, potential file overwriting risks, or error handling. For a file-writing tool with zero annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with three sentences that efficiently cover the core functionality, output behavior, and format support. It's front-loaded with the main purpose and avoids unnecessary repetition. However, the third sentence about 'intelligent format detection' could be integrated more smoothly, slightly affecting flow.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (file writing with multiple parameters), lack of annotations, and no output schema, the description is moderately complete. It covers the basic operation and output directory behavior but misses key contextual details like error handling, file naming specifics, or interaction with sibling tools. It's adequate for a simple write operation but lacks depth for robust agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all four parameters thoroughly. The description adds marginal value by mentioning 'auto-generated names based on content type' and 'intelligent format detection,' which loosely relates to the 'format' and 'title' parameters but doesn't provide additional syntax or format details beyond what the schema specifies. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Write content to document files in specified formats.' It specifies the action (write), resource (document files), and scope (multiple formats). However, it doesn't explicitly differentiate from sibling tools like 'create_word_document' or 'convert_document', which reduces it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides minimal usage guidance. It mentions that files are saved to OUTPUT_DIR with auto-generated names, but offers no explicit advice on when to use this tool versus alternatives like 'create_word_document' or 'convert_document' from the sibling list. There's no mention of prerequisites or when-not-to-use scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Tele-AI/doc-ops-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server