Skip to main content

read_console

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.read_console

Description

Gets messages from or clears the Unity Editor console. Defaults to 10 most recent entries. Use page_size/cursor for paging. Note: For maximum client compatibility, pass count as a quoted string (e.g., '5'). The 'get' action is read-only; 'clear' modifies ephemeral UI state (not project data).

Parameters

NameTypeRequiredDescription
actionLiteral['get', 'clear'] | NoneGet or clear the Unity Editor console. Defaults to 'get' if omitted.
typeslist[Literal['error', 'warning', 'log', 'all']] | str | NoneMessage types to get (accepts list or JSON string)
countint | str | NoneMax messages to return in non-paging mode (accepts int or string, e.g., 5 or '5'). Ignored when paging with page_size/cursor.
filter_textstr | NoneText filter for messages
page_sizeint | str | NonePage size for paginated console reads. Defaults to 50 when omitted.
cursorint | str | NoneOpaque cursor for paging (0-based offset). Defaults to 0.
formatLiteral['plain', 'detailed', 'json'] | NoneOutput format
include_stacktracebool | str | NoneInclude stack traces in output (accepts true/false or 'true'/'false')

Returns

A dict containing the Unity response. The exact shape depends on the action.

Examples

No examples yet. Add usage examples here — they will be preserved across regenerations.