Skip to main content
Glama
EL4CTEO

Roblox Studio MCP

Read scripts

script_read

Reads Luau source from Roblox Studio's live editor buffer, including unsaved changes, to avoid stale code. Supports partial line ranges, opening scripts at a line, and published-place reads.

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 `paths: [""]` 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. Changed1 schema field changedv0.8.0
    • changedInput schema / properties / list / description
      Previous value: -"live only: list what is under the first path instead of reading it. Pass an empty path list to see the top level."New value: +"live only: list what is under the first path instead of reading it. Pass `paths: [\"\"]` to see the top level."
  2. 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"
      +}
  3. 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"
      +}
  4. 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."
  5. First observedv0.1.8

TDQS

A5/5.0
Behavior5/5

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

Annotations are sparse (readOnlyHint=false, openWorldHint=true, idempotentHint=false, destructiveHint=false), so the description carries the burden. It discloses that reading includes unsaved changes from the live buffer, that `open` modifies the user's editor view, and that live mode has real limitations (only Folders/scripts, GUID round trips, seconds). It also flags disk-bound scripts as a race. This goes well beyond what annotations provide.

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 every sentence earns its place. It front-loads the core purpose, then systematically covers the live buffer, multi-script batching, disk-bound race, `open` behavior, `target="live"` constraints, and `list`. The structure uses clear paragraphs and examples, making it easy to scan. No redundancy or filler.

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?

Given the tool's complexity (10 parameters, multiple modes), the description covers all critical aspects: the live vs studio distinction, open vs read, line windows, defaults, list navigation, and output hints (line numbers for script_edit, disk-bound flag). It even notes the absence of output schema by implying return content. An agent can call this correctly without further clarification.

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?

Schema coverage is 100%, but the description adds substantial meaning: it explains the default startLine/endLine behavior for entries without their own, the two entry formats (bare path vs object with window), the semantics of `open` (returns nothing, puts cursor at line), and the purpose of `list: true` for navigation. It also clarifies `target="live"` limitations that the schema only hints at. This is a model of parameter enrichment.

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 ties it to `script_edit` by mentioning line numbers it accepts back. It clearly distinguishes from siblings like `script_edit` (editing) and `script_grep` (search) by focusing on reading. The mention of the live buffer vs saved property further clarifies its unique role.

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 explicitly advises when to use this tool: 'Pass every script you need in one call' and contrasts with reading the saved property to avoid stale code. It explains when `open` is appropriate ('when you are pointing at something they should see') and when `target="live"` is the right choice (checking deployed code). It also warns about the race condition for disk-bound scripts, giving clear when-not-to-use guidance.

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