Skip to main content
Glama

Write a file on a Mac

write_mac_file
DestructiveIdempotent

Writes a file of up to 3 MiB on the Mac: content as text, or content_base64. Relative paths are in the workspace; ~ is home. Creates missing folders and replaces a file in one step; executable marks a script. Safe to repeat.

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>"
    },
    "name": "write_mac_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFile to write. Relative paths are in the session workspace; ~ is the home folder.
contentNoThe file's text (UTF-8). Use content_base64 instead for binary files.
executableNoMake the file executable (for scripts).
session_idNoMac session ID (ses_…). Optional: without it, the account's running Mac.
content_base64NoThe file's bytes as base64, for binary files.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / session_id / description
      Previous value: -"Mac session ID (ses_…) returned by start_mac or list_mac_sessions."New value: +"Mac session ID (ses_…). Optional: without it, the account's running Mac."
    • changedInput schema / required
      Previous value: -[
      -  "session_id",
      -  "path"
      -]New value: +[
      +  "path"
      +]
  2. Changed2 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • changedOutput schema / (root)
      Previous value: -{
      -  "$schema": "http://json-schema.org/draft-07/schema#",
      -  "additionalProperties": {},
      -  "description": "The JSON response of the NoMac API for this operation",
      -  "properties": {
      -    "error": {
      -      "additionalProperties": {},
      -      "description": "Present only when the call failed",
      -      "properties": {
      -        "code": {
      -          "description": "Stable machine-readable error code, for example insufficient_credit",
      -          "type": "string"
      -        },
      -        "message": {
      -          "description": "What went wrong and what to do next",
      -          "type": "string"
      -        }
      -      },
      -      "required": [
      -        "code",
      -        "message"
      -      ],
      -      "type": "object"
      -    }
      -  },
      -  "type": "object"
      -}New value: +null
  3. Added

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnly=false, destructive=true, and idempotent=true; the description adds real context beyond them: a 3 MiB size ceiling, automatic creation of missing folders, one-step replacement of an existing file, and the executable bit for scripts. "Safe to repeat" slightly restates idempotentHint but usefully frames the destructive overwrite as repeatable. It does not mention permissions/auth or failure modes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Very dense and front-loaded: size limit, content modes, path rules, then side effects. Almost every clause carries information, though the workspace/~ sentence duplicates the schema's path description word for word and "executable marks a script" is clipped to the point of being cryptic.

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?

For a mutating tool with no output schema and full schema coverage, the description covers the important unknowns: size cap, overwrite/replace semantics, folder auto-creation, and path resolution. Gaps remain around the session_id targeting and whether a result (bytes written, final path) is returned.

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 coverage is 100%, so the baseline is 3, and the description mostly restates the schema's path text almost verbatim. It does add one genuinely new constraint — the 3 MiB content limit — which the schema does not express, and clarifies that executable is for scripts. However, session_id, which determines which Mac is written to, is never mentioned in the description.

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 opens with a specific verb and resource ("Writes a file ... on the Mac") and immediately scopes it with a size cap and the two content modes (text vs. content_base64). That is enough to distinguish it from the obvious sibling read_mac_file, but no sibling is named explicitly, so it stops short of a 5.

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?

It gives useful selection cues within the tool — use content for text, content_base64 for binary — and states the path resolution rule. It never says when to prefer this over alternatives (e.g., exec_mac for appending/streaming output, or read_mac_file to verify), and gives no preconditions about which Mac session is targeted.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources