Class ValidateScript
Handles validation of C# scripts and returns diagnostics.
Inherited Members
Namespace: Unity.AI.MCP.Editor.Tools
Assembly: Unity.AI.MCP.Editor.dll
Syntax
public static class ValidateScript
Fields
Description
Description of the Unity.ValidateScript tool functionality and parameters.
Declaration
public const string Description = "Validate a C# script and return diagnostics.\n\nArgs: uri, level=('basic'|'standard'), include_diagnostics (bool, optional).\n- basic: quick syntax checks.\n- standard: deeper checks (performance hints, common pitfalls).\n- include_diagnostics: when true, returns full diagnostics and summary; default returns counts only."
Field Value
| Type | Description |
|---|---|
| string |
Methods
GetOutputSchema()
Gets the JSON schema describing the output format of the Unity.ValidateScript tool.
Declaration
[McpOutputSchema("Unity.ValidateScript")]
public static object GetOutputSchema()
Returns
| Type | Description |
|---|---|
| object | An object representing the JSON schema for the tool's output. |
HandleCommand(ValidateScriptParams)
Handles script validation commands by analyzing C# scripts for errors and warnings.
Declaration
[McpTool("Unity.ValidateScript", "Validate a C# script and return diagnostics.\n\nArgs: uri, level=('basic'|'standard'), include_diagnostics (bool, optional).\n- basic: quick syntax checks.\n- standard: deeper checks (performance hints, common pitfalls).\n- include_diagnostics: when true, returns full diagnostics and summary; default returns counts only.", null, null, Groups = new string[] { "core", "scripting" })]
public static object HandleCommand(ValidateScriptParams parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| ValidateScriptParams | parameters | The validation parameters including URI, validation level, and diagnostic options. |
Returns
| Type | Description |
|---|---|
| object | A response object containing validation results with error and warning counts, and optionally full diagnostics. |