Skip to main content
Glama

mcp_script_write

Create, overwrite, or delete files in an agent's scripts folder by supplying content or remove=true, with built-in refusal when the agent uses the default API key or a write.lock is present.

Instructions

Create or overwrite a file in agent's scripts/ folder with content, or delete it with remove=true. name is a bare filename of up to 32 characters (letters, digits, . _ -, no leading dot or dash, no paths). Refused while the agent still has the default api_key, and once a write.lock file is in the folder. Writing write.lock (any content) locks every script write, and this tool can then no longer change or remove it. The lock does not stop runs: a script run with mcp_script_run that deletes files can remove write.lock, as can a shell (Pi) or USB (Pico, ESP32).

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": {
      "agent": "<agent>",
      "name": "<name>"
    },
    "name": "mcp_script_write"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
agentYes
removeNo
contentNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.30

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations at all, the description carries the full burden and does so: it discloses two refusal preconditions, the lock's self-locking side effect (this tool cannot later change or remove write.lock), and the escape hatches (mcp_script_run script, Pi shell, Pico/ESP32 USB). That is exactly the mutation/lockout context an agent needs before writing.

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-loads the core action, then naming rules, then refusal conditions, then lock semantics — a sensible order with no filler. The final two sentences about lock escape hatches are long and lean toward mcp_script_run documentation, but they are decision-relevant here because they describe how the agent can undo its own lockout.

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 four-parameter mutation tool with no annotations and no output schema, this is close to sufficient: naming constraints, refusal conditions, overwrite semantics and lock consequences are all present. Remaining gaps are the meaning/format of the required `agent` parameter and any hint of what a successful call returns.

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?

Schema description coverage is 0%, so the description must compensate, and it does for three of four parameters: `name` gets length, character set and format restrictions, `remove` selects deletion, `content` supplies the payload. `agent` is required but never defined in the description (which agent identifier form, what happens if it doesn't exist), and it is unstated that `content` is effectively required when remove is false.

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: create/overwrite a file in `agent`'s scripts/ folder, with the delete variant folded in via remove=true. It is clearly separable from siblings that read (mcp_script_read), list (mcp_script_list) or execute (mcp_script_run) the same artifacts.

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

Usage Guidelines4/5

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

Tells the agent that deletion goes through this same tool via remove=true rather than a separate delete call, and names the conditions under which calls are refused (default api_key still in place, or a write.lock present). It does not explicitly contrast with siblings like mcp_script_read/mcp_script_list, but the write-vs-run boundary is made clear by the lock discussion.

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