Skip to main content
Glama
EL4CTEO

Roblox Studio MCP

Edit scripts

script_edit
Destructive

Apply batch edits to Luau scripts in Roblox Studio, ensuring all changes are applied atomically.

Instructions

Edits Luau source through the Studio script editor. This is the tool to use for any change to existing code.

Every edit in one call is all-or-nothing: the whole batch is resolved against current source before anything is written, so if one edit cannot be applied nothing is. Batch related changes together, even across different scripts.

Each edit picks exactly one mode: find/replace — literal text, not a pattern. Preferred: it survives line numbers shifting. Fails if the text is not unique, unless you set replaceAll, so include enough surrounding lines to pin it down. startLine/endLine + replacement — for line ranges from script_read. Numbers refer to the file as you read it; several line edits to one script are applied bottom-up so they do not shift each other. source — replaces the whole script. Only for small files or a rewrite; it discards anything the user changed since you read it.

Writes go through ScriptEditorService:UpdateSourceAsync, so an open editor tab updates in place and unsaved work is preserved. Undo for source changes is the script editor's own, per script — Ctrl+Z in a script tab reverts that script, not the whole batch.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
editsYesEdits to apply together as one undoable step.
studioIdNoTarget Studio; omit for the active one.
Behavior5/5

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

Beyond the annotations, it discloses critical behavior: all-or-nothing batch semantics, non-unique find refusal, bottom-up application of line edits, preservation of unsaved work, per-script undo scope, and the fact that source replacement discards user changes. No contradiction with the destructiveHint annotation.

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?

The description is long but earned: the core purpose is front-loaded, the three edit modes are clearly separated, and the implementation and undo details are directly relevant to correct use. Every sentence either clarifies a parameter, sets expectations, or prevents misuse.

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

Completeness5/5

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

For a complex, destructive edit tool, the description covers invocation semantics, failure modes, concurrency behavior, and undo behavior comprehensively. No output schema exists, but the agent has everything needed to construct correct calls and predict consequences.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema coverage is 100%, the description adds meaningfully to the parameters: it explains the three mutually exclusive edit modes, why find is literal, when replaceAll is needed, how line numbers relate to a previous script_read, and what source replacement implies. This goes well beyond the schema's property descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action — editing Luau source through the Studio script editor — and explicitly frames it as the tool for any change to existing code. This clearly distinguishes it from creation or read-only tools like script_create and script_read.

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

Usage Guidelines5/5

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

It gives explicit when-to-use guidance ('the tool to use for any change to existing code') and provides mode-level selection guidance: find/replace is preferred, line ranges come from script_read, and source replacement is only for small files or rewrites. This is actionable and reduces guesswork.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EL4CTEO/rbx-studio-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server