Skip to main content
Glama

Create Files

create
Destructive

Write whole text files—new, overwriting, or appended—and create empty directories including missing parent folders. Use it when you have full content or need folders; for partial edits use edit, replace_text, or patch instead.

Instructions

Write whole text files (new, overwrite, or append) and create empty directories, with missing parents. Use when you have full content or need folders. Do not use it for partial edits; use edit, replace_text, or patch instead, and move to copy or rename. Whole-file writes are atomic (temp file, then rename); appends are not. An existing file is replaced only with overwrite: true or after one user confirmation for the batch; nothing is written before the answer. Declined entries fail with CANCELLED; skipped ones land in skipped. Entries fail alone; the call errors only when all fail. Returns files (path, size, lineCount, mimeType, kind, resourceUri, created, modified), directories, failures, skipped, and an undo id for undo (30 min), or undoUnavailable.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "create"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesNoFiles to write. Give files, directories, or both. Combined content per call is at most FS_MAX_FILE_SIZE (default 10 MiB).
directoriesNoEmpty directories, created recursively; an existing directory succeeds; a path also listed in files is rejected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.22.0
    • changedInput schema / properties / directories / items / description
      Previous value: -"File or directory path inside an allowed workspace root."New value: +"File or directory path inside a root, absolute or relative to it."
    • changedInput schema / properties / files / items / properties / path / description
      Previous value: -"Absolute file path inside a writable root; one entry per file."New value: +"File path inside a writable root, absolute or relative to it; one entry per file."
  2. Changed1 schema field changedv2.21.0
    • changedInput schema / properties / files / items / properties / append / description
      Previous value: -"Add content to the end, adding no newline; creates a missing file. Never asks; wins over overwrite. lineCount is 0 past FS_MAX_FILE_SIZE."New value: +"Add content to the end, starting a new line if needed; creates a missing file. Never asks; wins over overwrite. lineCount is 0 past FS_MAX_FILE_SIZE."
  3. Changed6 schema fields changedv2.20.0
    • changedInput schema / properties / directories / description
      Previous value: -"Empty directories to create, like mkdir -p; one that already exists is left as it is"New value: +"Empty directories, created recursively; an existing directory succeeds; a path also listed in files is rejected."
    • changedInput schema / properties / files / description
      Previous value: -"List of files to create (max 100); each entry requires path and content; combined content is capped at the file-size limit"New value: +"Files to write. Give files, directories, or both. Combined content per call is at most FS_MAX_FILE_SIZE (default 10 MiB)."
    • changedInput schema / properties / files / items / properties / append / description
      Previous value: -"Append the content verbatim, adding no newline; creates the file if it does not exist"New value: +"Add content to the end, adding no newline; creates a missing file. Never asks; wins over overwrite. lineCount is 0 past FS_MAX_FILE_SIZE."
    • changedInput schema / properties / files / items / properties / content / description
      Previous value: -"Text content to write, verbatim."New value: +"Full text to write, verbatim, as UTF-8."
    • changedInput schema / properties / files / items / properties / overwrite / description
      Previous value: -"Replace an existing file without asking the user; without it an existing file prompts for confirmation. A client that cannot show a prompt fails with INVALID_INPUT and a workaround instead."New value: +"Replace an existing file without asking. Without it, a client that cannot show the prompt fails the whole call with INVALID_INPUT."
    • changedInput schema / properties / files / items / properties / path / description
      Previous value: -"Absolute path where the file will be created"New value: +"Absolute file path inside a writable root; one entry per file."
  4. Changed1 schema field changedv2.18.2
    • changedInput schema / properties / files / items / properties / overwrite / description
      Previous value: -"Replace an existing file without asking the user; without it an existing file prompts for confirmation"New value: +"Replace an existing file without asking the user; without it an existing file prompts for confirmation. A client that cannot show a prompt fails with INVALID_INPUT and a workaround instead."
  5. Changed1 schema field changedv2.17.0
    • changedInput schema / properties / files / items / properties / append / description
      Previous value: -"Append the content to the end of the file instead of overwriting; creates the file if it does not exist"New value: +"Append the content verbatim, adding no newline; creates the file if it does not exist"
  6. Changed2 schema fields changedv2.9.1
    • addedInput schema / properties / directories
      Added value: +{
      +  "description": "Empty directories to create, like mkdir -p; one that already exists is left as it is",
      +  "items": {
      +    "description": "File or directory path inside an allowed workspace root.",
      +    "maxLength": 4096,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "maxItems": 100,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "files"
      -]
  7. Changed1 schema field changedv2.7.0
    • changedInput schema / properties / files / description
      Previous value: -"List of files to create (max 100); each entry requires path and content"New value: +"List of files to create (max 100); each entry requires path and content; combined content is capped at the file-size limit"
  8. Changed1 schema field changedv2.4.1
    • addedInput schema / $schema
      Added value: +"https://json-schema.org/draft/2020-12/schema"
  9. Changed2 schema fields changedv2.3.0
    • addedInput schema / properties / files / items / properties / append
      Added value: +{
      +  "description": "Append the content to the end of the file instead of overwriting; creates the file if it does not exist",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / files / items / properties / overwrite
      Added value: +{
      +  "description": "Replace an existing file without asking the user; without it an existing file prompts for confirmation",
      +  "type": "boolean"
      +}
  10. Addedv2.0.0

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the destructive and non-idempotent annotations, it discloses atomic whole-file writes, non-atomic appends, overwrite confirmation behavior, CANCELLED/skipped outcomes, per-entry failure isolation, and all-fail call failure. It also explains the undo window and return fields, which materially informs safe invocation.

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 dense but front-loaded: purpose first, exclusions and alternatives next, then atomicity, confirmation, failure, and return semantics. Every sentence carries operational information for a destructive multi-entry file-writing tool.

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?

There is no output schema, yet the description explains returned files, directories, failures, skipped entries, and the undo id. For a destructive tool with nested file entries and batch behavior, it provides the context needed to call and interpret results correctly.

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

Parameters4/5

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

The schema already documents parameters at 100% coverage, so the baseline is 3. The description adds operational meaning around overwrite confirmation being batch-level and 'nothing is written before the answer,' plus the distinction between declined and skipped entries, which helps an agent decide how to set overwrite/append behavior.

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?

It states a specific verb and resource: write whole text files and create empty directories. It distinguishes the tool from partial-edit siblings by naming `edit`, `replace_text`, and `patch`, and from `move` for copy/rename.

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

Usage Guidelines5/5

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

The description gives explicit when-to-use guidance ('full content or need folders') and when-not guidance ('Do not use it for partial edits'), with alternatives named. This leaves little ambiguity about selecting this tool.

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