Skip to main content
Glama

Write a file on a Mac

write_mac_file
Destructive

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.

Input Schema

TableJSON 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

B3.3/5.0
Behavior1/5

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

The description ends with 'Safe to repeat', but annotations declare idempotentHint=false (and destructiveHint=true). Claiming repeat-safety directly conflicts with the structured idempotency signal, so the description misleads on retry behavior even though its other disclosures (folder creation, replacement, 3 MiB cap, executable) are useful.

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?

Front-loaded with the verb and size limit, and every clause (path resolution, folder creation, replacement, executable, repeat-safety) carries information. Slightly dense semicolon stacking keeps it just short of ideal.

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?

Annotations cover readOnly/destructive/openWorld, the schema is fully described, and there is no output schema, so the description need only add behavior — which it does (size cap, path semantics, folder creation, replacement). The one gap is that the retry/idempotency claim is wrong, and no auth/permission context is given.

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 100%, so path, content, content_base64, executable, and session_id are already fully documented in the schema, closely mirroring the description's wording. The description adds the 3 MiB content cap and the text-vs-base64 choice, but largely repeats structured data, so the baseline 3 applies.

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?

States a specific verb and resource ('Writes a file ... on the Mac') plus a concrete constraint (up to 3 MiB). The wording clearly distinguishes it from the sibling read_mac_file and from exec_mac without needing the schema.

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 routes the agent between the two content modes ('content as text, or content_base64'), which is useful selection guidance, but gives no explicit when-to-use versus siblings (e.g., read_mac_file, exec_mac) and no when-not conditions. Usage is implied rather than stated.

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