read_console_messages
Fetch console log entries from a specified browser tab, with optional regex filtering, error-only mode, and result limits to aid debugging.
Instructions
Hand back the console output firefox-use has buffered for one tab: log, info, warn and error entries, plus uncaught page exceptions with their stack frames. Every line arrives as an ISO timestamp, the level in brackets and the text, oldest first, and an error also shows the frame it was thrown from. Capture is lazy - the buffer only starts filling the first time you call this tool or read_network_requests in a session, so anything printed before that was never seen; reload and read again. A tab keeps its 1000 most recent entries, and the whole log is dropped when that tab moves to a different origin (a new scheme, host or port each count), so read before you send the page somewhere else; the reply says so when either of those cost you entries. tabId is the only required argument and has to name a tab this session owns - tabs_context_mcp lists them. Send a pattern nearly every time: on a talkative app an unfiltered read buries the two lines you were after.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clear | No | Set true to empty this tab's console buffer once the reply has been assembled, so your next read shows only what arrived after this one. False by default, which means the same lines will be reported again. | |
| limit | No | Ceiling on how many matching entries come back, newest kept. 100 when omitted. The header counts any matches this cap held back, so raise it once you see that it actually bit. | |
| tabId | Yes | Numeric id of the tab to read, as reported by tabs_context_mcp or tabs_create_mcp. It must be one of the tabs in this session's group, and it is required - leave it out and the call errors instead of guessing which tab you meant. | |
| pattern | No | A JavaScript regular expression, applied case-insensitively. An entry survives when the expression hits either its text or its level, so 'warn|error' selects by severity while 'CheckoutForm' selects by content. A malformed expression comes back as an error rather than being quietly ignored, and so does one that backtracks past the one-second matching budget - drop the nested quantifiers if that happens. Optional, but give one whenever you can narrow the search: it is the difference between the lines you need and a wall of noise. | |
| onlyErrors | No | Set true to keep just the severe entries - console.error, console.assert, anything logged at severe or critical, and uncaught exceptions - and discard info, log and warn. Omitted it is false, and every level comes through. |