script-read
Read a Unity script file's content by specifying its file path, with optional line range parameters to return specific portions as a string.
Instructions
Reads the content of a script file and returns it as a string. Use 'script-update-or-create' tool to update or create script files.
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": {
"filePath": "<filePath>"
},
"name": "script-read"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Path to the script file. Example: "Assets/Scripts/MyScript.cs" | |
| lineFrom | No | The line number to start reading from (1-based). | 1 |
| lineTo | No | The line number to stop reading at (1-based, -1 for all lines). | -1 |