Skip to main content
Glama

write_file

Create a new text file and automatically generate parent directories; overwrite existing files only when explicitly enabled.

Instructions

Tạo file text mới (tự tạo thư mục cha). Ghi đè file có sẵn chỉ khi overwrite=True.

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"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
contentYes
overwriteNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/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 disclosure burden. It usefully adds two behavioral facts beyond the schema: parent directories are created automatically, and existing files are replaced only when overwrite=True (default false). However, it never says what actually happens when the file exists and overwrite is left false — error, silent no-op, or partial write — nor anything about permissions or content encoding.

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?

Two short sentences with no filler; the core action comes first and the safety-relevant overwrite condition is stated immediately after. Every clause adds information that is not available elsewhere.

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?

An output schema exists, so return-value explanation is unnecessary, and the description covers the two facts an agent most needs before calling: directory creation and the overwrite gate. The remaining gap is the undefined behavior on a pre-existing file when overwrite is false, which matters for a mutation tool with no annotations.

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 0% for 3 parameters, so the description must compensate. It does explain the semantics of overwrite (the flag that gates replacement of an existing file), which is the one non-obvious parameter. Path and content are left entirely to their names with no format, encoding, or path-style guidance, so compensation is only partial.

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 verb and resource ('Tạo file text mới' = create a new text file) plus the key scope detail that parent directories are auto-created. It does not name the read-only siblings (list_dir, read_file, search_code), but the write/read distinction is obvious from the verb, so differentiation is adequate without being explicit.

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?

Usage is implied rather than stated: an agent can infer this is the tool for persisting new text content, and that overwriting is opt-in via overwrite=True. There is no explicit 'use this instead of X' guidance and no statement of prerequisites such as write permissions or acceptable path forms.

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

Deploy Server

Other Tools