Skip to main content
Glama

Script / Read

script-read
Read-onlyIdempotent

Read Godot C# or GDScript files from res:// and return content plus metadata, with optional line-range slicing for partial reads before updating or creating scripts.

Instructions

Read a Godot script file (C# '.cs' or GDScript '.gd') under res:// and return its content + metadata (res:// path, language, line count). Supports an optional 1-based 'lineFrom'/'lineTo' slice for partial reads (indices are clamped — out-of-range values read at-most the whole file). Pair with 'script-update'/'script-create' to write back. The file is read with Godot's FileAccess so it works on any res:// path (imported or not). Returns a structured ScriptInfo.

Input Schema

NameRequiredDescriptionDefault
lineToNo1-based inclusive end line of the slice (default -1 = end of file). Clamped into range.
lineFromNo1-based start line of the slice (default 1). Clamped into range.
scriptPathYesres:// path of the script to read, e.g. 'res://scripts/player.gd' or 'res://scripts/Enemy.cs'. Must end in '.cs' or '.gd'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.35.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the safety profile is covered. The description still earns credit by adding behavior beyond them: the read goes through Godot's FileAccess so it works on imported and non-imported res:// paths, and out-of-range slice values are clamped to at-most the whole file rather than erroring.

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?

Front-loaded with the core purpose in the first sentence, then slice behavior, then the write-back pairing, then the FileAccess caveat — a sensible order. A few stacked parentheticals add density, but no sentence is 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?

No output schema exists, and the description fully compensates by enumerating the returned fields (res:// path, language, line count, content) and naming the ScriptInfo shape. Combined with slice clamping and path validation notes, an agent has everything needed to call it correctly on the first try.

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 baseline is 3, but the description adds meaning: '1-based' indexing and the clamping policy ('out-of-range values read at-most the whole file') clarify edge behavior that the per-property 'Clamped into range' notes only gesture at. It stops short of 5 because the slice semantics are largely restated from the schema.

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?

States a specific verb and resource ('Read a Godot script file') along with the accepted extensions (.cs/.gd), the path namespace (res://), and the return payload (content + path, language, line count). This is clearly distinguishable from the file-lifecycle siblings script-update/script-create, which it explicitly cites as the write-side counterparts.

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?

Gives real usage context: read here, then pair with script-update/script-create to write back, and the optional slice for partial reads. It lacks an explicit exclusion (e.g., when to prefer script-validate or rql-query over reading raw content), so it stops just short of full when/when-not routing.

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