Default MCP tab tools to the active tab
Requiring an explicit tab_id forced every navigate or close through a preceding tabs_list call, which costs an MCP client a full round trip just to learn the ID the browser already considers current. navigate and tabs_close now resolve the active tab when tab_id is omitted, matching the screenshot tool. Resolution is explicit rather than forwarding None into the SDK, so the acting tool knows which tab it touched; tabs_close reports it, since closing the wrong tab is not recoverable. This stays in the MCP layer: the SDK and CLI signatures are unchanged.
This commit is contained in:
@@ -174,6 +174,11 @@ The server is stateless at the MCP layer. Every tool call creates a fresh
|
||||
`browser`, `remote`, and `key` on a tool call when a specific local profile or
|
||||
authenticated browser-cli remote is required.
|
||||
|
||||
`browser_navigate`, `browser_tabs_close`, and `browser_screenshot` take an
|
||||
optional `tab_id` and act on the active tab when it is omitted, so a caller
|
||||
does not need a preceding `browser_tabs_list` round trip. `browser_tabs_close`
|
||||
reports the tab it closed.
|
||||
|
||||
Available tools:
|
||||
- `browser_tabs_list`, `browser_tabs_open`, `browser_tabs_close`
|
||||
- `browser_navigate`, `browser_page_info`
|
||||
|
||||
Reference in New Issue
Block a user