Class ReadConsole
Handles reading and clearing Unity Editor console log entries. Uses reflection to access internal LogEntry methods/properties.
Inherited Members
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. |