Skip to main content
Glama

Read a script's source

get_script_source
Read-only

Reads a Roblox script’s source by dotted path, using executor decompilation when available and falling back to the Source property.

Instructions

Read the source code of a Script, LocalScript or ModuleScript by dotted path. It uses the executor's decompile when available and falls back to the Source property. Decompiled sources are cached in the executor (fromCache in the result, refresh decompiles again). Long sources are cut at max_chars. Requires the connected state.

Input Schema

NameRequiredDescriptionDefault
pathYesDotted path to the script, starting at game.
clientNoClient id from list_clients, for example c2. Defaults to the client that connected last.
refreshNoDecompile again instead of using the cached source (default false).
max_charsNoMaximum number of characters to return (default 20000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.4.0
    • addedInput schema / properties / refresh
      Added value: +{
      +  "description": "Decompile again instead of using the cached source (default false).",
      +  "type": "boolean"
      +}
  2. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the annotations, it discloses decompiler availability, fallback to the Source property, executor-side caching, the fromCache result flag, refresh behavior, truncation, and the connection dependency. These details help the agent anticipate source provenance, staleness, and incomplete output without contradicting the read-only 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?

Five short sentences front-load the purpose and then cover mechanism, caching, truncation, and prerequisites without filler. The parenthetical efficiently connects fromCache and refresh to the caching behavior.

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?

Together with the fully described schema and annotations, this supplies nearly everything needed for a correct call, including supported classes, connectivity, cache controls, and size limiting. With no output schema, the lone mention of fromCache leaves the broader result shape and any truncation indicator unspecified, and sibling-selection guidance is absent.

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 100%, and the description largely restates path, refresh, and max_chars semantics already documented there. The caching and truncation context aids interpretation, but little new parameter-specific information is added and client receives no additional explanation.

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?

The opening sentence precisely states the operation, supported resources, and addressing mode: reading a Script, LocalScript, or ModuleScript by dotted path. It does not explicitly distinguish this exact-path source reader from siblings such as inspect_code or list_scripts.

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 dotted-path wording establishes the main use case of retrieving a known script's source, and "Requires the connected state" supplies a prerequisite. It lacks explicit when-not guidance or routing to list_scripts or search_scripts when the path is unknown.

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