Skip to main content
Glama

write_script

Create or update Roblox Script, LocalScript, or ModuleScript instances under a parent path, with automatic Undo recording for safe script authoring.

Instructions

Create or update a Script, LocalScript, or ModuleScript under parent_path (wrapped in Undo recording).

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

Input Schema

NameRequiredDescriptionDefault
nameYes
sourceYes
parent_pathYes
script_classNoScript

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations at all, the description carries the full disclosure burden, and it does contribute one genuinely useful trait: the operation is 'wrapped in Undo recording,' so changes are recoverable in Studio. However, it omits that updating replaces existing source (destructive), whether parent_path must exist, and any permission or failure behavior.

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 front-loaded sentence with the action and resource first and the Undo caveat parenthesized at the end; 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?

An output schema exists, so return values need not be explained, but for a 4-parameter write tool with zero schema description coverage the description should still convey source format and overwrite semantics. It handles the class enumeration and Undo behavior but leaves the most consequential parameter, 'source', undefined.

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. It does add meaning for parent_path (the containing location) and effectively enumerates the allowed script_class values ('Script, LocalScript, or ModuleScript'), which the schema leaves as a free-form string with no enum. It adds nothing about 'source' (expected Luau code) or name uniqueness, so compensation is only partial.

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?

It states a concrete verb pair ('Create or update') plus the exact resource types ('Script, LocalScript, or ModuleScript') and the containment scope ('under parent_path'). That is enough to distinguish it from read-only siblings like read_script and grep_scripts, though it never explicitly says why one would pick this over create_instance.

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?

The 'create or update' phrasing implies it handles both new and existing scripts, which is mild usage signal, but there is no explicit when-to-use, no mention of what happens when the script already exists, and no reference to any sibling such as create_instance or read_script.

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