File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ export const newPage = defineTool({
129129 ) ;
130130
131131 response . setIncludePages ( true ) ;
132+ response . setListInPageTools ( ) ;
132133 } ,
133134} ) ;
134135
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
1919 closePage ,
2020 listPages ,
2121 navigatePage ,
22+ newPage ,
2223 selectPage ,
2324} from '../src/tools/pages.js' ;
2425import type { InsightName } from '../src/trace-processing/parse.js' ;
@@ -1188,4 +1189,19 @@ describe('inPage tools', () => {
11881189 ) ;
11891190 } , 'navigate_page' ) ;
11901191 } ) ;
1192+
1193+ it ( 'includes in-page tools in new_page response' , async ( ) => {
1194+ await testIncludesInPageTools ( async ( response , context ) => {
1195+ // Workaround to ensure the test environment's new page contain in-page tools
1196+ sinon . stub ( context , 'newPage' ) . resolves ( context . getSelectedMcpPage ( ) ) ;
1197+
1198+ await newPage . handler (
1199+ {
1200+ params : { url : 'about:blank' } ,
1201+ } ,
1202+ response ,
1203+ context ,
1204+ ) ;
1205+ } , 'new_page' ) ;
1206+ } ) ;
11911207} ) ;
You can’t perform that action at this time.
0 commit comments