Skip to main content
Glama

write_script

Replace a Roblox Script, LocalScript, or ModuleScript source by path to update code in Studio, with undoable changes you can roll back using Ctrl+Z.

Instructions

Replace the source of a Script/LocalScript/ModuleScript by path (undoable).

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

Input Schema

NameRequiredDescriptionDefault
pathYes
sourceYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden, and it does disclose one valuable trait: the change is '(undoable)'. The word 'Replace' also signals that prior source is fully overwritten rather than appended. It omits error behavior for a nonexistent path, permission/mode requirements, and whether the script is created if absent.

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?

A single sentence with the operation, target types, addressing method, and the undo guarantee front-loaded. Nothing is redundant or padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-required-param mutation with no annotations and no output schema, the definition is minimally adequate: an agent knows what it does and that it is reversible. Missing path-format and failure-mode details leave real gaps for an agent constructing the call.

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 0%, so the description must compensate, and it only partly does: 'by path' implies the path identifies a script instance, and 'source' implies the replacement text. It never specifies the path syntax (dotted instance path vs. service-qualified) or whether source is raw Luau text, which is the main ambiguity for a required string param.

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?

States a specific verb ('Replace the source') and a specific resource set ('Script/LocalScript/ModuleScript'), plus the addressing mechanism ('by path'). This clearly separates it from read_script and from set_property, though no sibling is named explicitly to sharpen the boundary.

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

Usage Guidelines2/5

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

There is no when-to-use or when-not-to-use guidance. It never says whether to prefer this over set_property on a script's Source property, or whether execute_luau is the alternative for generating source dynamically, and no prerequisites (edit mode, script must already exist) are stated.

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