get_console_logs
Retrieve cached console messages from a Chrome tab for debugging script errors, monitoring page health, and inspecting exception traces. Optionally filter by severity level or clear the cache.
Instructions
Retrieves cached console messages including log, warning, error, info levels and uncaught exceptions. Side effects: optionally clears cache when 'clear' is true. 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. | |
| 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). |