Skip to main content
Glama
EL4CTEO

Roblox Studio MCP

Read scripts

script_read

Reads Luau script source from Roblox Studio, including unsaved editor changes, and returns line numbers for precise edits. Use it to inspect current code before modifying scripts.

Instructions

Reads Luau source from one or more scripts, with line numbers that script_edit accepts back verbatim.

Source comes from the Studio script editor's live buffer, so anything the user has typed but not yet saved is included. Reading the saved property instead would hand you stale code and you would 'fix' the change they just made.

Pass every script you need in one call, including when you want a different part of each: an entry may be a bare path for the whole file, or {path, startLine, endLine} for a window into that one script. The top-level startLine/endLine are the default for entries that do not carry their own.

A script bound to a file on disk is flagged in the result. Editing one of those is a race: whatever writes the file wins, and your change disappears the next time it does, with nothing anywhere reporting a failure.

open puts a script on the user's screen at a line, instead of telling them where to look. Ask for it when you are pointing at something they should see; it is not automatic, and reading twenty scripts does not rearrange their editor.

target="live" reads the code of the PUBLISHED place instead, with no Studio involved — which is how you check what is actually deployed rather than what is on someone's machine. Two limits are real and worth knowing before you reach for it: Roblox's Instance API can only see Folders and scripts, so a path through a Model or a Part cannot be walked at all; and it addresses things by GUID with no search, so each segment of the path costs a round trip. Expect seconds. list: true shows what is under a path instead of reading it, which is how you find your way down.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opNo'read' returns source. 'open' opens the first path in the user's Studio editor at `line` and returns nothing to read.read
lineNoopen only: line to put the cursor on.
listNolive only: list what is under the first path instead of reading it. Pass an empty path list to see the top level.
pathsYesScripts to read, e.g. ["ServerScriptService.Systems.Combat"] or [{ path: "...Combat", startLine: 120, endLine: 180 }].
targetNo'studio' reads the open place. 'live' reads the published place over Open Cloud, Folders and scripts only.studio
endLineNoDefault last line for entries without their own, inclusive. Omit to read to the end.
placeIdNolive only: omit to use `cloud place`.
studioIdNoTarget Studio; omit for the active one.
startLineNoDefault first line for entries without their own, 1-based and inclusive. Omit to start at the top.
universeIdNolive only: omit to use `cloud universe`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.6.8
    • addedInput schema / properties / list
      Added value: +{
      +  "description": "live only: list what is under the first path instead of reading it. Pass an empty path list to see the top level.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / placeId
      Added value: +{
      +  "description": "live only: omit to use `cloud place`.",
      +  "type": "string"
      +}
    • addedInput schema / properties / target
      Added value: +{
      +  "default": "studio",
      +  "description": "'studio' reads the open place. 'live' reads the published place over Open Cloud, Folders and scripts only.",
      +  "enum": [
      +    "studio",
      +    "live"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / universeId
      Added value: +{
      +  "description": "live only: omit to use `cloud universe`.",
      +  "type": "string"
      +}
  2. Changed2 schema fields changedv0.6.5
    • addedInput schema / properties / line
      Added value: +{
      +  "description": "open only: line to put the cursor on.",
      +  "maximum": 9007199254740991,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / op
      Added value: +{
      +  "default": "read",
      +  "description": "'read' returns source. 'open' opens the first path in the user's Studio editor at `line` and returns nothing to read.",
      +  "enum": [
      +    "read",
      +    "open"
      +  ],
      +  "type": "string"
      +}
  3. Changed5 schema fields changedv0.3.0
    • changedInput schema / properties / endLine / description
      Previous value: -"Last line to return, inclusive. Omit to read to the end."New value: +"Default last line for entries without their own, inclusive. Omit to read to the end."
    • changedInput schema / properties / paths / description
      Previous value: -"Script paths, e.g. [\"ServerScriptService.Systems.Combat\"]."New value: +"Scripts to read, e.g. [\"ServerScriptService.Systems.Combat\"] or [{ path: \"...Combat\", startLine: 120, endLine: 180 }]."
    • addedInput schema / properties / paths / items / anyOf
      Added value: +[
      +  {
      +    "description": "A script path, read in full.",
      +    "type": "string"
      +  },
      +  {
      +    "properties": {
      +      "endLine": {
      +        "description": "Last line of the window for this script, inclusive.",
      +        "maximum": 9007199254740991,
      +        "minimum": 1,
      +        "type": "integer"
      +      },
      +      "path": {
      +        "description": "The script to read.",
      +        "type": "string"
      +      },
      +      "startLine": {
      +        "description": "First line of the window for this script, 1-based and inclusive.",
      +        "maximum": 9007199254740991,
      +        "minimum": 1,
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "path"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedInput schema / properties / paths / items / type
      Removed value: -"string"
    • changedInput schema / properties / startLine / description
      Previous value: -"First line to return, 1-based and inclusive. Omit to start at the top."New value: +"Default first line for entries without their own, 1-based and inclusive. Omit to start at the top."
  4. First observedv0.1.8

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only say openWorldHint=true and destructiveHint=false, so the description carries the burden and exceeds it. It discloses that source comes from the live editor buffer, that file-bound scripts are a race with no failure reporting, that open rearranges the user's screen, that live mode has Instance API limitations (Folders/scripts only, GUID addressing, round-trip cost, seconds), and that list shows contents instead of reading. These are exactly the behavioral traits an agent needs to avoid incorrect calls.

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?

The description is long but every paragraph earns its place: buffer semantics, batching guidance, file-bound race, open behavior, live-mode limits, and list behavior. It is front-loaded with the core read action and line-number contract, then expands into mode-specific guidance. Slightly dense, but not padded.

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 10-parameter tool with no output schema, the description covers the critical context: what source is read, how to batch, how windows work, what open does, what live mode can and cannot do, and how to navigate with list. The only minor gap is not describing the result shape, but with no output schema and the description already explaining the flagged file-bound scripts, the agent has enough to call correctly.

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 is 100%, so the baseline is 3. The description adds meaning beyond the schema by explaining the top-level startLine/endLine act as defaults for entries without their own, that an entry may be a bare path or a window object, and that list:true with an empty path list shows the top level. It also clarifies the live-mode constraints on paths. This is meaningful added semantics, though the schema already documents each parameter well.

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 opens with a specific verb and resource: 'Reads Luau source from one or more scripts' and immediately distinguishes itself from script_edit by noting line numbers are accepted back verbatim. It also covers the open variant and the live target, so an agent can tell exactly what this tool does versus siblings like script_grep or script_edit.

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?

The description gives explicit when-to-use guidance: read the live buffer rather than saved property to avoid stale code, pass all scripts in one call, use open when pointing the user at something, and use target='live' to check the published place. It also names alternatives implicitly by explaining what open and list do instead of reading, and warns against editing file-bound scripts. This is rich routing guidance.

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