Skip to content

Commit 7765bb3

Browse files
authored
fix: update tool reference in an error (#205)
Closes #170 Closes #169
1 parent 1f4007e commit 7765bb3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/McpContext.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import type {
2121

2222
import {NetworkCollector, PageCollector} from './PageCollector.js';
2323
import {listPages} from './tools/pages.js';
24+
import {takeSnapshot} from './tools/snapshot.js';
2425
import {CLOSE_PAGE_ERROR} from './tools/ToolDefinition.js';
2526
import type {Context} from './tools/ToolDefinition.js';
2627
import 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

0 commit comments

Comments
 (0)