Skip to main content

Console

Access browser console output for debugging. browser_console_messages is part of the core capability and always available.

browser_console_messages

Returns the console messages collected for the current tab, preceded by a count summary.

ParameterTypeRequiredDescription
levelstringnoMinimum level: error, warning, info (default), debug. Each level includes the messages of more severe levels
allbooleannoReturn all messages since the beginning of the session, not just since the last navigation. Defaults to false
filenamestringnoSave the messages to a file instead of returning them as text
→ browser_console_messages

Total messages: 4 (Errors: 1, Warnings: 1)

[ERROR] Uncaught TypeError: Cannot read property 'map' of undefined @ app.js:42
[WARNING] Deprecation: 'window.webkitStorageInfo' is deprecated.
[LOG] App initialized in 234ms
[LOG] User session restored

→ browser_console_messages { level: "error" }

Total messages: 4 (Errors: 1, Warnings: 1)
Returning 1 messages for level "error"

[ERROR] Uncaught TypeError: Cannot read property 'map' of undefined @ app.js:42

Tool responses also carry a - New console entries: line pointing at the messages logged since the previous response, so the LLM knows when it is worth calling this tool.

The default level for the whole session can be set with --console-level=<level>.

Workflow: debugging a broken page

You: The page looks broken. Check the console for errors.

→ browser_console_messages { level: "error" }

[ERROR] Failed to fetch: GET https://api.example.com/data 404
[ERROR] Uncaught Error: API returned 404

→ browser_network_requests { filter: "api" }
// Confirm the failing request, then mock it or investigate further