-
Notifications
You must be signed in to change notification settings - Fork 522
feat: add compact console message formatting with filtering options #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add compact console message formatting with filtering options #183
Conversation
It would be great if we could also add further filtering parameters, such as search query filtering on console messages by input -> In addition, we could also filter on specific datetimes by allowing the LLM to provide ISO formatted input -> This would greatly optimise the number of context tokens input and output, and makes the whole agentic experience more efficient, improving time to accurate results. Not sure if the above would necessitate a new GitHub issue, or can be bundled into the PR branch as additional commit(s)? |
In what contexts, give examples.
rgds,
Murillo Dutt
DUTT™ eCommerce Website Design
Tallinn/Estonia | Coimbra/Porgutal
Goiânia/Brazil | Curitiba/Brazil
Em dom., 28 de set. de 2025 às 10:41, Sayvai ***@***.***>
escreveu:
… *Sayvai* left a comment (ChromeDevTools/chrome-devtools-mcp#183)
<#183 (comment)>
It would be great if we could also add further filtering parameters, such
as search query filtering on console messages by input -> query.
In addition, we could also filter on specific datetimes by allowing the
LLM to provide ISO formatted input -> from and input -> to values.
This would greatly optimise the number of context tokens input and output,
and makes the whole agentic experience more efficient, improving time to
accurate results.
—
Reply to this email directly, view it on GitHub
<#183 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGLFPAHATCT5JDKWBFVLRT3U7QRFAVCNFSM6AAAAACHVLCEY6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGNBTGQYTCMRTGA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Simple if you think about it, as the output of the MCP tool can return a much refined subset of console messages back to the LLM, thereby mitigating and reducing the need for additional irrelevant info being fed back to the LLMs' context window, thus reducing token usage count, and thereby minimising end-user costs. Example 1 - Input ->
|
@Sayvai, I like your suggestions. I think it's best to implement it in a new PR and make a new GitHub issue. |
Glad you agree @ronantakizawa 🙂 As suggested, I've created a new scoped GitHub issue for the work 👇 |
Thanks for the PR! we are discussing right now how to implement in the best way and I think the PR does not quite align with what are discussing (use the same pagination mechanism as in the network requests tool, support multiple levels, provide a detailed tool to get stack traces). We are planning to address the underlying issue soon though and we will see if we incorporate parts of the PR into the solution. |
this is good PR originaly address what i mention from my issue. but this
sounds like a bandaid patch for the real problem, the question why list_console_messages has duplicated messages? even with playwright MCP its still the same, so im sure its using similar logic, OR this is browser CDP related. I ended up creating my own debug tool (extension) because i really needed it asap. AI is actually 10x better in debugging with the right tools. Hoping ChromeDevtools MCP will fix all this issues soon so i wont need my own extension. |
@santoldev can you please share more on how you accomplished this?
Did you find a way to modify the MCP itself to expose filtering, before the tools respond? |
Fixes issue #171.
Fixes the console message verbosity issue by implementing compact formatting and filtering options for
list_console_messages
.Problem
The list_console_messages tool was generating ~5x more tokens than necessary due to verbose formatting
that included:
This made the tool impractical for debugging workflows where users needed to examine console output.
Solution
Compact Mode (Default)
New Filtering Parameters
Smart Deduplication ( Creates a map using message text as the key)
Usage Examples
// Compact format (default) - minimal tokens
list_console_messages()
// Only errors with verbose details
list_console_messages({level: "error", compact: false})
// First 50 logs with timestamps
list_console_messages({limit: 50, includeTimestamp: true})