Skip to content

Commit 7d3f02b

Browse files
committed
fix: block tool calls when a dialog is open
1 parent cde4dc1 commit 7d3f02b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ export async function createMcpServer(
199199
? context.getPageById(params.pageId)
200200
: context.getSelectedMcpPage();
201201
response.setPage(page);
202+
if (page.getDialog() && tool.name !== 'handle_dialog') {
203+
throw new Error(
204+
'A browser dialog is open. Call handle_dialog to accept or dismiss it before continuing.',
205+
);
206+
}
202207
await tool.handler(
203208
{
204209
params,

0 commit comments

Comments
 (0)