docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ReadConsole

    Handles reading and clearing Unity Editor console log entries. Uses reflection to access internal LogEntry methods/properties.

    Inheritance
    object
    ReadConsole
    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 ReadConsole

    Fields

    Description

    Gets the description text for the Unity.ReadConsole tool. Describes the available parameters and return values for reading or clearing console messages.

    Declaration
    public const string Description = "Gets messages from or clears the Unity Editor console.\n\nArgs:\n    Action: Operation ('Get' or 'Clear').\n    Types: Message types to get ('Error', 'Warning', 'Log', 'All').\n    Count: Max messages to return.\n    FilterText: Text filter for messages.\n    SinceTimestamp: Get messages after this timestamp (ISO 8601).\n    Format: Output format ('Plain', 'Detailed', 'Json').\n    IncludeStacktrace: Include stack traces in output.\n\nReturns:\n    Dictionary with results. For 'get', includes 'data' (messages)."
    Field Value
    Type Description
    string

    Methods

    GetOutputSchema()

    Returns the output schema for this tool.

    Declaration
    [McpOutputSchema("Unity.ReadConsole")]
    public static object GetOutputSchema()
    Returns
    Type Description
    object

    The JSON schema object describing the tool's output structure.

    HandleCommand(ReadConsoleParams)

    Main handler for console management actions. Processes Unity.ReadConsole tool requests to get or clear Unity console messages.

    Declaration
    [McpTool("Unity.ReadConsole", "Gets messages from or clears the Unity Editor console.\n\nArgs:\n    Action: Operation ('Get' or 'Clear').\n    Types: Message types to get ('Error', 'Warning', 'Log', 'All').\n    Count: Max messages to return.\n    FilterText: Text filter for messages.\n    SinceTimestamp: Get messages after this timestamp (ISO 8601).\n    Format: Output format ('Plain', 'Detailed', 'Json').\n    IncludeStacktrace: Include stack traces in output.\n\nReturns:\n    Dictionary with results. For 'get', includes 'data' (messages).", null, null, Groups = new string[] { "debug", "editor" })]
    public static object HandleCommand(ReadConsoleParams parameters)
    Parameters
    Type Name Description
    ReadConsoleParams parameters

    The parameters specifying the console operation to perform.

    Returns
    Type Description
    object

    A Response object containing the operation result. For 'Get' actions, includes console log entries in the data field.

    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)