Skip to content

Feature Request: add query and datetime filters to list_console_message tool #197

@Sayvai

Description

@Sayvai

Is your feature request related to a problem? Please describe.

The list_console_messages tool returns a number of unfiltered results (messages) back to the LLM.

This amounts to unnecessary build-up of irrelevant tokens for LLM context parsing / usage, thereby accumulating cost, not just in currency, but also in LLM processing speed inefficiencies, and potentially negatively impacting accuracy / relevance of LLM output results.

Describe the solution you'd like

Add further filtering parameters, such as search query filtering on console messages by input -> query.

In addition, we could also filter on specific datetime ranges by allowing the LLM to provide ISO formatted input -> from_datetime and input -> to_datetime values.

This should extend the recent work applied in the following PRs:

Example 1 - Input -> query

  • I add-in specifically formatted console messages (e.g. namespaced with "[some-file.ts]: ..."), and I ask then the LLM to search for and return all browser console messages which contains the above namespace.
  • The LLM makes the appropriate call to the console tool, and it will pass in the query filter input query
  • The MCP tool will return a specific subset of console messages only that were asked for by the me back to LLM for parsing without overloading / polluting the tool output response back to the LLM of all other irrelevant console message.

Example 2 - Input -> from_datetime / input -> to_datetime

  • The MCP controlled browser session has been running for like lets say 15 minutes already, and plenty of console.logs are general throughout that time as the browser goes through various interaction states.
  • I ask LLM to give me a summary of the logs that were generated over the last few minutes which is of my particular use-case / concern that I want to delve deeper into.
  • The LLM will make the tool call and appropriately specify the above datetime inputs
  • The MCP tool will respond with only the subset of console messages as per my request.

Benefits

  • Reduced LLM context token wastage, and by positive implication, cost ($)
  • Reduced unnecessary parsing of additional irrelevant messages
  • Reduction in unnecessary LLM noise / confusion, thus LLM analysis results / feedback
  • May even improve speed of overall LLM output process, as there would be less messages to parse

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions