docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ValidateScript

    Handles validation of C# scripts and returns diagnostics.

    Inheritance
    object
    ValidateScript
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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.

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)