Skip to main content
Glama

script_write

Replaces a Roblox Studio script's entire source and creates the script plus any missing parent folders when needed; changes are undoable.

Instructions

Replace a script's whole source, creating the script (and missing parent Folders) if needed. 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": "script_write"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
classNoClass when creating. Default ModuleScript.
sourceYes
studioNoOptional. Target Studio (name substring, place id or id). Only needed when several Studios are open and none was selected.
run_contextNoOptional RunContext when creating a Script.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.6/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 burden. It helpfully discloses that the operation is undoable and that it creates the script and any missing parent Folders, but it says nothing about permissions or auth, what happens to an existing script of a conflicting class, error behavior, or whether the entire source is destroyed unrecoverably.

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?

Two front-loaded sentences with zero waste. The creation side-effect and undoability come first, where the agent needs them.

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 destructive write tool with no annotations and no output schema, the definition covers the essential side effects (creates, overwrites, undoable) but leaves gaps around failure modes and return behavior. It is adequate but not complete.

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 coverage of 60% is high enough for a baseline of 3–4. The description adds meaning to 'path' beyond the schema (parent Folders are auto-created), while class, studio, and run_context are handled by the schema's own descriptions and enums.

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?

Uses a specific verb and resource ('Replace a script's whole source') and adds scope ('whole source'), which implicitly contrasts with the sibling script_edit's partial edits. It never names that sibling, though, so the distinction must be inferred.

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?

An implicit when-to-use is conveyed by 'whole source' and by the create-if-missing behavior, but there are no explicit exclusions such as 'use script_edit for partial changes' or conditions around when creating a script is appropriate.

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