Skip to main content
Glama

write_file_tool

Write or overwrite file content at a specified path with optional encoding, enabling AI tools to create and update files on the local filesystem through Pathgate.

Instructions

Write content to a file (creates or overwrites)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>",
      "content": "<content>"
    },
    "name": "write_file_tool"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute or relative path to the file
contentYesContent to write
encodingNoFile encoding (default: utf-8)utf-8

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden; it does disclose the most important trait, that existing content is silently overwritten. It says nothing about parent-directory creation, permission failures, atomicity, or what is returned after a write, leaving meaningful gaps for a mutation tool.

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?

A single sentence with the destructive overwrite behavior front-loaded in parentheses; no filler or redundancy. It is sized appropriately for the little it attempts to convey.

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?

With no annotations and no output schema, the description is the only source of behavioral context for a mutating tool, and it covers purpose plus overwrite semantics but omits failure modes and side effects. Adequate as a minimum, but short of what an agent needs to call it safely.

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 path, content, and encoding are all documented with types and a default; the baseline of 3 applies. The description adds no further meaning, such as whether the path is resolved relative to a working directory.

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?

Uses a specific verb and resource ("Write content to a file") and adds the key scope note that it "creates or overwrites," which an agent can use to distinguish it from read_file_tool. It never names a sibling or contrast case, so differentiation is inferred rather than stated.

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?

There is no guidance on when to choose this over copy_file_tool or move_file_tool, nor on preconditions such as whether the parent directory must exist. The parenthetical only describes effect, not usage conditions or exclusions.

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