Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
clearNoSet 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.
limitNoCeiling 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.
tabIdYesNumeric 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.
patternNoA 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.
onlyErrorsNoSet 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description thoroughly discloses behavior: lazy capture, buffer size (1000 entries per tab), origin-change reset, output format (ISO timestamp, level, text, stack frames), behavior of the clear flag (empties buffer after reply), limit cap effect, and error handling for patterns (malformed or backtracking). It also states that read-only semantics are not pure because clear can modify state, and annotations are absent, so the description carries the full burden.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Although lengthy, every sentence carries essential information—no fluff. The structure front-loads the main function, then details buffering behavior, then parameter specifics. Repetitive phrasing about buffer limits and lazy capture reinforces critical constraints without adding noise. The description is dense but well-organized and necessary given the tool's nuances.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers all necessary context an agent needs: how to trigger capture, what the output looks like, how to limit results, how to filter, error conditions, and state-changing behavior (clear). It explains edge cases like origin changes and lazy capture, and mentions the header reporting held-back entries. Nothing essential is missing for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description goes beyond the field-level comments by adding context: it restates required tabId, explains the interaction between clear and subsequent reads, clarifies that limit caps apply to matches and headers count held-back entries, details pattern matching rules (case-insensitive, hits text or level), and gives a concrete example ('warn|error'). This elevates understanding of each parameter's practical behavior.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: returning console output (log, info, warn, error, uncaught exceptions) for a specific tab. It explicitly distinguishes from sibling read_network_requests by naming it and describing the different resource, satisfying the verb+resource requirement.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides actionable usage guidance: explains the lazy capture (first call triggers buffering, so reload if needed), advises using the pattern parameter to narrow results, warns about malformed regexes causing errors, and gives clear instructions on the clear parameter for subsequent reads. It tells when to use the tool and how to get the best results.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.