get_console_logs
Retrieve console logs from a Chrome tab to debug errors, monitor health, and inspect exceptions. Filter by severity and clear after retrieval.
Instructions
Retrieves cached console messages including log, warning, error, info levels and uncaught exceptions. Side effects: when 'clear' is true the cached console messages are emptied after being returned. Prerequisites: requires an active Chrome tab. Returns: JSON array of console messages with timestamp, level, and text. Use this to debug script errors, monitor page health, inspect exception traces. Alternatives: browser DevTools Console, error logging services.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clear | No | Clear console cache after returning logs. Constraints: boolean. Interactions: when true, subsequent calls only return new messages. Defaults to: false. | |
| tab_id | No | The Tab ID of the target tab. Omit to use the active tab. | |
| instance_id | No | Chrome instance id from open_instance/list_instances. Omit for the default instance. | |
| level_filter | No | Filter logs by severity level (case-insensitive). Constraints: 'error', 'warning', 'info', 'log', or similar CDP log level. Interactions: when provided, returns only matching level; empty returns all. Defaults to: None (no filtering). |