Read C# Script
unity_read_scriptRead 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'.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "unity_read_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Project-relative script path, e.g. 'Assets/Scripts/PlayerController.cs' | |
| max_lines | No | Maximum lines to return | |
| start_line | No | First line to return (1-based) | |
| response_format | No | Output format: 'markdown' for human-readable or 'json' for machine-readable | markdown |