Skip to main content
Glama

write_file

Writes full text content to a file on a specified host, replacing the existing file if present.

Instructions

Write a text file on a host, replacing it if it exists.

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": {
      "host": "<host>",
      "path": "<path>",
      "content": "<content>"
    },
    "name": "write_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
hostYes
pathYesA path on the host; relative paths start at the home directory.
contentYesThe whole new content of the file, as text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations at all, the description carries the full behavioral burden. It does disclose the key destructive trait — an existing file is silently overwritten — which is genuinely valuable, but it says nothing about required permissions, whether parent directories are created, encoding/size limits, or error behavior.

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?

One sentence, front-loaded with the action and resource, with the overwrite caveat attached rather than buried. No filler words; every clause carries information.

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

Completeness2/5

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

For a mutating file-write tool with zero annotations and no output schema, the definition is thin: nothing on whether the host must be an existing session or reachable host, whether the parent path must exist, what is returned, or how failures surface. The overwrite note helps but does not cover the gaps an agent needs before calling it.

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 67%: path and content are already documented, while host is bare in the schema and the description also does not explain it (host name? alias? connection string?). The description adds little parameter meaning beyond restating that content is text and the target is a host, so baseline 3 is appropriate.

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?

States a specific verb and resource ("Write a text file") plus the scope ("on a host"), and adds the important side effect that an existing file is replaced. An agent can distinguish it from read_file, list_dir, or upload by the write/replace semantics, though no sibling is named.

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 explicit when-to-use or when-not-to-use guidance and no alternatives are named, even though upload, add_snippet, and run_command could plausibly overlap. The only implicit cue is that this creates/replaces a file, which an agent must infer is the right choice for writing text content.

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