Skip to main content
Glama

write

Create or overwrite a file with specified content while preserving original encoding and using editorconfig hints. Auto-creates parent directories as needed.

Instructions

Creates or overwrites a file with the given content. Encoding-aware: preserves original encoding for existing files, uses .editorconfig hints for new files. Auto-creates parent directories if they don't exist.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoAlias for file_path
contentYesContent to write to the file
file_pathNoFile to write. Relative paths use the configured workspace or MCP client root

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv0.9.5
    • changedInput schema / properties / file_path / description
      Previous value: -"Absolute path to the file to write"New value: +"File to write. Relative paths use the configured workspace or MCP client root"
  2. Addedv0.8.7
  3. Removed
  4. Changed1 schema field changedv0.7.12
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": false,
      -  "properties": {
      -    "result": {
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "type": "object"
      -}New value: +null
  5. First observedv0.4.2

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the transparency burden, and it handles it well: it discloses overwriting behavior, encoding preservation, editorconfig usage for new files, and automatic creation of parent directories. It doesn't describe return values or error conditions, but the core behavioral risks are covered.

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

Conciseness5/5

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

The description is three short sentences, each carrying distinct useful information: core write behavior, encoding behavior, and directory behavior. It is front-loaded with the main operation and contains no filler.

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

Completeness4/5

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

For a simple write tool with no output schema and no annotations, the description covers the essential input semantics (content, path), the destructive write behavior, and the main edge cases (encoding and parent directories). It could mention return values or error handling, but an agent has enough to call and use it correctly.

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?

The schema already documents all three parameters with descriptions, and schema description coverage is 100%, so the description is not required to add parameter-level detail. The description provides useful global context about encoding and parent directory behavior, but not parameter-specific semantics beyond the schema.

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 states a specific operation: 'Creates or overwrites a file with the given content', making clear this is a full-file write. It is distinguished from sibling tools like edit or patch by the overwrite semantics, though it doesn't explicitly name those alternatives.

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

Usage Guidelines3/5

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

The primary usage is clear: use this tool when creating a new file or fully replacing existing content. However, there is no explicit guidance about preferring edit or patch for targeted modifications, so the routing decision is implied rather than stated.

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

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/knewstimek/agent-tool'

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