Skip to main content
Glama
code-and-relax

Roblox Studio MCP Server

get_script_source

Retrieve Roblox script source code with optional line numbering. Specify start and end lines to read large scripts in sections for accurate editing.

Instructions

Get the source code of a Roblox script (LocalScript, Script, or ModuleScript). Returns both "source" (raw code) and "numberedSource" (with line numbers prefixed like "1: code"). Use numberedSource to accurately identify line numbers for editing. For large scripts (>1500 lines), use startLine/endLine to read specific sections.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endLineNoOptional: End line number (inclusive). Use for reading specific sections of large scripts.
startLineNoOptional: Start line number (1-indexed). Use for reading specific sections of large scripts.
instancePathYesRoblox instance path to the script using dot notation (e.g., "game.ServerScriptService.MainScript", "game.StarterPlayer.StarterPlayerScripts.LocalScript")
Behavior4/5

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

With no annotations provided, the description carries the full burden of transparency. It discloses the dual return fields (source and numberedSource), explains the line-number prefix format, and suggests parameter usage for large scripts. It does not mention error behavior for invalid paths or non-script instances, but for a read-only tool this is a minor gap. The information provided is sufficient for expected use.

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 three sentences long, with the primary purpose front-loaded. Each sentence adds distinct value: purpose, return format details, and usage guidance. There is no fluff or redundancy, making it easy for an agent to parse quickly.

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?

Despite having no output schema, the description fully explains the return values and their formats. The parameter coverage is complete via the schema, and the tool's complexity is low. The provided context is sufficient for an AI agent to invoke the tool correctly and interpret results. Minor omissions like error handling are not critical for a read operation.

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?

The schema provides complete descriptions for all three parameters (100% coverage), earning a baseline of 3. The description adds value by explaining why and when to use startLine/endLine (for scripts >1500 lines) and how numberedSource relates to line editing. This goes beyond the schema's basic parameter 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 clearly states the tool's function: 'Get the source code of a Roblox script' and specifies the script types (LocalScript, Script, or ModuleScript). It distinguishes from sibling write/edit tools like set_script_source and edit_script_lines by focusing on retrieval. The return formats are explicitly named, leaving no ambiguity about the tool's purpose.

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

Usage Guidelines4/5

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

The description offers clear guidance on when to use the numberedSource format for line-accurate editing and when to use startLine/endLine for large scripts (>1500 lines). It does not explicitly mention when not to use the tool or alternative tools, but the read-vs-write distinction from siblings is implicit. The usage context is clear and actionable.

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/code-and-relax/robloxstudio-mcp'

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