Skip to main content
Glama

write_file

Create or replace files with UTF-8 text, PDF, or DOCX using HTML formatting. Supports rich formatting like headings, tables, and styles.

Instructions

Create/replace files. Supports text (UTF-8), PDF, and DOCX with HTML formatting.

PDF/DOCX with HTML Formatting:

  • Provide HTML content for rich formatting (headings, bold, italic, colors, tables, lists)

  • Supports: -, , , , , , , , ,

  • CSS styling: colors, fonts, alignment, borders, margins, padding

  • Example: 'TitleContent'

  • Plain text fallback: If content is not HTML, creates simple formatted document

Text files: UTF-8 encoding. Overwrites without confirmation.

IMPORTANT - Multi-line Content:

  • Use actual newline characters in the content string, NOT escape sequences like \n

  • MCP/JSON will handle the encoding automatically

  • Incorrect: {"content": "line1\nline2"} - this writes literal \n characters

  • Correct: Use actual line breaks in your JSON string value

Only works within allowed directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
contentYesFile content to write. For multi-line content, use actual newlines in the string value, not escape sequences like \n. Example: 'line1\nline2' should be formatted as an actual multi-line string in JSON.
Behavior5/5

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

Discloses key behaviors: 'Overwrites without confirmation', only works in allowed directories, and how content is interpreted (HTML vs plain text). Also warns about multi-line encoding issues. No annotations present, so description fully covers behavioral traits.

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?

Well-structured with sections, but slightly lengthy. Front-loaded with purpose. Could be more concise by trimming the HTML tag list, but still efficient given the valuable info.

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

Completeness5/5

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

Comprehensive for a write tool: covers formats, encoding, directory limitations, and multi-line handling. No output schema, but return behavior is implied. Appropriate given sibling tools and no nested objects.

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

Parameters5/5

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

Adds significant meaning beyond the input schema: path context (allowed directories) and extensive content details (format support, HTML tags, multi-line instructions). Schema coverage is 50%, but the description compensates fully.

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

Purpose5/5

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

Clearly states 'Create/replace files' and specifies supported formats (text, PDF, DOCX with HTML). Distinguishes from sibling tools like edit_file (for modifying) and read_file (for reading) by focusing on writing and specific formats.

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

Usage Guidelines4/5

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

Provides explicit guidance on multi-line content formatting and allowed directories. Implies appropriate use for creating/replacing files, but does not explicitly state when not to use or mention alternatives like edit_file for editing.

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/n0zer0d4y/vulcan-file-ops'

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