Skip to content

Commit 6ba125b

Browse files
committed
fix: update tool reference in an error
1 parent 4202513 commit 6ba125b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/McpContext.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {CLOSE_PAGE_ERROR} from './tools/ToolDefinition.js';
2525
import type {Context} from './tools/ToolDefinition.js';
2626
import type {TraceResult} from './trace-processing/parse.js';
2727
import {WaitForHelper} from './WaitForHelper.js';
28+
import { takeSnapshot } from './tools/snapshot.js';
2829

2930
export interface TextSnapshotNode extends SerializedAXNode {
3031
id: string;
@@ -261,7 +262,7 @@ 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(`No snapshot found. Use ${takeSnapshot.name} to capture one.`);
265266
}
266267
const [snapshotId] = uid.split('_');
267268

0 commit comments

Comments
 (0)