Skip to main content
Glama

studio_write_script

Destructive

Update an existing Roblox Studio script safely by supplying expected_source for conflict protection; edits must be enabled, and changes are undoable.

Instructions

Update an existing script using expected_source for conflict protection. Requires edits enabled; undoable in Studio.

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": {
      "session_id": "<session_id>",
      "path": "<path>",
      "expected_source": "<expected_source>",
      "source": "<source>"
    },
    "name": "studio_write_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesInstance name segments starting with a service; duplicate sibling names are rejected
sourceYes
session_idYesExact session_id from studio_sessions. Never assume the current game is the intended target.
expected_sourceYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the safety profile is known; the description goes beyond that by disclosing the optimistic-concurrency guard (expected_source) and the edits-enabled prerequisite. Reversibility is also stated. It does not say what happens when expected_source mismatches, which is the main remaining behavioral gap.

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 short sentences, front-loaded with the operation and its conflict-safety mechanism, then the prerequisite and undo note. No filler.

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 destructive mutation with annotations covering safety and no output schema, the description supplies the prerequisite, the concurrency contract, and reversibility. Missing only the conflict-failure behavior and a word on what source replaces.

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 50%; session_id and path carry schema text, while source and expected_source have empty descriptions. The description rescues expected_source by explaining it as a conflict-protection token, but leaves source (the replacement content) and its relationship to expected_source implicit.

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 and resource ("Update an existing script") and names the concurrency mechanism (expected_source). Clear enough to distinguish from studio_read_script, though it never explicitly contrasts with a create/write-new counterpart.

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?

Provides a prerequisite ("Requires edits enabled") and a reversibility note ("undoable in Studio"), which imply when the call will succeed. It gives no explicit when-not guidance or alternative for creating a new script versus updating an existing one.

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