File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import type {
2121
2222import { NetworkCollector , PageCollector } from './PageCollector.js' ;
2323import { listPages } from './tools/pages.js' ;
24+ import { takeSnapshot } from './tools/snapshot.js' ;
2425import { CLOSE_PAGE_ERROR } from './tools/ToolDefinition.js' ;
2526import type { Context } from './tools/ToolDefinition.js' ;
2627import type { TraceResult } from './trace-processing/parse.js' ;
@@ -261,7 +262,9 @@ export class McpContext implements Context {
261262
262263 async getElementByUid ( uid : string ) : Promise < ElementHandle < Element > > {
263264 if ( ! this . #textSnapshot?. idToNode . size ) {
264- throw new Error ( 'No snapshot found. Use browser_snapshot to capture one' ) ;
265+ throw new Error (
266+ `No snapshot found. Use ${ takeSnapshot . name } to capture one.` ,
267+ ) ;
265268 }
266269 const [ snapshotId ] = uid . split ( '_' ) ;
267270
You can’t perform that action at this time.
0 commit comments