validate_script
Auto-generated from the Python tool registry. Do not hand-edit outside
<!-- examples:start --><!-- examples:end -->blocks — the generator (tools/generate_docs_reference.py) will overwrite them.
Group: core · Module: services.tools.manage_script
Maturity: stable (support status; independent of enabled state, readiness and permissions).
Description
Validate a C# script and report diagnostics, the effective validation engine, and context limitations. This does not trigger Unity project compilation.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
uri | str | yes | URI of the script to validate under Assets/ directory, mcpforunity://path/Assets/... or file://... or Assets/... |
level | Literal['basic', 'standard'] | — | basic checks structure; standard adds available compiler syntax and heuristic Unity rules. See returned validation capabilities. |
include_diagnostics | bool | — | Include full diagnostics and summary |
unity_instance | str | int | None | — | Target Unity instance for this call: Name@hash or hash prefix; an integer selects only that exact port over stdio and is rejected over HTTP. Read mcpforunity://instances for available targets. Omit to use the legacy active selection or the sole available instance. |
Returns
A dict containing the Unity response. The exact shape depends on the action.
Examples
Ask the Editor to validate the Harbor fixture's Assets/BerthProbe.cs and include diagnostics. For another project, use its script path.
MCP arguments
{
"uri": "Assets/BerthProbe.cs",
"include_diagnostics": true
}