Open Bug 2081597 Opened 1 month ago Updated 2 days ago

[firefox-devtools-mcp] Report pages opened or closed during a tool call

Categories

(Developer Infrastructure :: Firefox MCP, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned)

References

(Blocks 5 open bugs)

Details

When a tool call opens a page (popup, target=_blank link, window.open) or closes one, the agent is not told. It has to call list_pages to find out.

Add a short ### Changes block to the tool response when pages were opened or closed during the call. Example:

When nothing changed, the response must stay exactly as it is today. This also covers pages closed by the page itself, or by the user in connect-existing mode.

Implementation:

  • Update the cached page list from browsingContext.contextCreated and contextDestroyed events, so we do not call refreshTabs() after every tool call. The page order must stay the same as the order refreshTabs() produces.
  • In the tool dispatcher (src/index.ts), compare the page list before and after the handler runs, and build the "Changes" block from the difference.

Other bugs in the meta will add more lines to this block...

Blocks: 2081599
Blocks: 2081600
Blocks: 2081601
Blocks: 2081602
Blocks: 2081603
See Also: → 2081622
See Also: → 2095715
You need to log in before you can comment on or make changes to this bug.