Skip to main content
Glama

Read C# Script

unity_read_script
Read-onlyIdempotent

Read Unity script files by path with line numbers and pagination, returning requested line ranges so you can inspect code before updating it.

Instructions

Read a script with line numbers, paginated. Always read before updating.

Args: path ('Assets/Scripts/X.cs'), start_line (1-based, default 1), max_lines (default 200). Returns { path, total_lines, start_line, content } — content lines prefixed 'line: code'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesProject-relative script path, e.g. 'Assets/Scripts/PlayerController.cs'
max_linesNoMaximum lines to return
start_lineNoFirst line to return (1-based)
response_formatNoOutput format: 'markdown' for human-readable or 'json' for machine-readablemarkdown

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the bar is lower; the description still adds real behavior: pagination via start_line/max_lines, the line-number prefix format, and the read-before-write requirement. It doesn't mention error behavior for missing files, but the added context is substantive.

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?

Front-loaded purpose in the first sentence, usage rule second, then a compact Args/Returns block. No filler sentences; every line carries information an agent needs.

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?

With no output schema, the description usefully documents the return shape ({ path, total_lines, start_line, content }) and the line-prefix convention. It omits the response_format parameter and any note on pagination end conditions (total_lines matters for continuing), leaving a small gap for a paginated reader.

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 description coverage is 100%, so all four parameters are already documented, including defaults and the path example. The description restates default values for start_line and max_lines without adding format or edge-case meaning, so the baseline 3 applies.

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+resource ('Read a script') plus the distinguishing scope ('with line numbers, paginated'), which cleanly separates it from unity_list_scripts, unity_create_script, and unity_update_script. An agent can identify the operation without opening the schema.

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?

'Always read before updating' gives explicit workflow guidance and implicitly routes the agent here before unity_update_script. It stops short of stating exclusions (e.g., when to use unity_list_scripts instead for discovery), so it is clear context without full when-not coverage.

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