豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 7f947ba

Browse files
committed
fix: list_pages should work after selected page is closed
list_pages was defined with definePageTool which marks it as pageScoped. This causes the handler dispatch in index.ts to call getSelectedMcpPage() before invoking the handler. When the selected page has been closed, getSelectedPptrPage() throws an error instead of returning the page list. list_pages doesn't actually use the page parameter — its handler only calls response.setIncludePages(true). Change it to defineTool so it bypasses the page-scoped check and works regardless of whether a page is currently selected. Fixes #1138
1 parent 57e7d51 commit 7f947ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tools/pages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
timeoutSchema,
1717
} from './ToolDefinition.js';
1818

19-
export const listPages = definePageTool(args => {
19+
export const listPages = defineTool(args => {
2020
return {
2121
name: 'list_pages',
2222
description: `Get a list of pages ${args?.categoryExtensions ? 'including extension service workers' : ''} open in the browser.`,

0 commit comments

Comments
 (0)