All tools

file_write

Files & Finder · macOS · Windows

Effect: write (strongest supported action). Status: gated.

Gated means the tool requires an installed app, a connected account, permission, or runtime availability. Check those requirements on the listed platform before using it.

macOS

Purpose

Writes text to a local file — create, overwrite, or append. For .txt/.md/.csv/.json/.log and any plain-text or code file. (For Word use word_create, Excel excel_create, PowerPoint ppt_create.) Writes anywhere on this Mac, with two exceptions: files your machine runs by itself (shell startup files, LaunchAgents, git hooks, AI-client configs) and credential locations are never written. Overwriting an existing file requires confirm=true (the first call returns a preview instead); append=true adds to the end and never needs confirm. Missing parent folders are created.

Required inputs

Permissions and confirmation

Explicit confirmation parameter: inspect the schema and tool description before any real call. The documentation example keeps confirm false. Obtain user authorization before performing the action.

Full input schema — macOS
{
  "properties": {
    "append": {
      "description": "Append to the end instead of overwriting (default false)",
      "type": "boolean"
    },
    "confirm": {
      "description": "Required (true) to OVERWRITE an existing file. Not needed to create a new file or to append.",
      "type": "boolean"
    },
    "content": {
      "description": "Text content to write",
      "type": "string"
    },
    "path": {
      "description": "Absolute path to the file to write",
      "type": "string"
    }
  },
  "required": [
    "path",
    "content"
  ],
  "type": "object"
}

Documentation example

Do not execute this example. These concrete inputs refer to a fictional demonstration dataset. Resolve real handles and obtain user authorization before any real call.

{
  "confirm": false,
  "content": "Meeting agenda: review the launch checklist.",
  "path": "/Users/demo/Documents/meeting-notes.txt"
}

Windows

Purpose

Writes text to a local file — create, overwrite, or append. The path must be inside an allowed folder (home directory by default; extend via config key fs_allowed_roots). Missing parent folders are created. Overwriting an existing file requires confirm=true (the first call returns a preview instead); creating a new file and append=true never need confirm.

Required inputs

Permissions and confirmation

Explicit confirmation parameter: inspect the schema and tool description before any real call. The documentation example keeps confirm false. Obtain user authorization before performing the action.

Full input schema — Windows
{
  "properties": {
    "append": {
      "description": "Append to the end instead of overwriting (default false).",
      "type": "boolean"
    },
    "confirm": {
      "description": "Required (true) to OVERWRITE an existing file. Not needed to create a new file or to append.",
      "type": "boolean"
    },
    "content": {
      "description": "Text content to write.",
      "type": "string"
    },
    "path": {
      "description": "Absolute path to the file to write.",
      "type": "string"
    }
  },
  "required": [
    "path",
    "content"
  ],
  "type": "object"
}

Documentation example

Do not execute this example. These concrete inputs refer to a fictional demonstration dataset. Resolve real handles and obtain user authorization before any real call.

{
  "confirm": false,
  "content": "Meeting agenda: review the launch checklist.",
  "path": "C:\\Users\\demo\\Documents\\meeting-notes.txt"
}