Skip to main content
Glama

write_script

Writes full Lua source code directly to Roblox Studio Script, LocalScript, or ModuleScript instances; set force=true to bypass safety checks when needed.

Instructions

Write full source to a Script/LocalScript/ModuleScript. Use force=true to bypass safety checks.

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
pathYesPath to the script
forceNoBypass safety checks (default false)
clientNoTarget a specific Studio client by name (as shown on the panel, e.g. "studio"). Omit to auto-pick: the only active client, or the most recently active one when several are connected.
sourceYesFull Lua source code to write

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/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. 'Write full source' usefully signals whole-file replacement, and the force flag is flagged as bypassing safety checks, but it never says what those checks protect, whether writes are reversible, whether a missing script is created, or what errors surface.

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?

Two short sentences, front-loaded with the core action and the destructive-flag caveat immediately after. No filler, though the second sentence largely duplicates the force parameter description.

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 a fully documented schema and no output schema, the essentials are covered: what is overwritten and how to escalate. The main gaps — create-vs-overwrite behavior and safety-check consequences — are non-trivial but narrow.

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 path, source, force, and client are all documented in the schema already. The description only restates the force semantics and adds nothing about source format expectations or client selection beyond what the schema says — baseline 3 applies.

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 ('Write full source') and concrete resource targets (Script/LocalScript/ModuleScript) with a path example, which implicitly distinguishes it from edit_script's partial edits. It never names read_script or edit_script outright, so the disambiguation is inferential rather than explicit.

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?

Gives one conditional rule — use force=true to bypass safety checks — which is real usage guidance. It offers no guidance on when to prefer this tool over edit_script for partial changes, or whether the target script must already exist, leaving the main selection question to inference.

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