Skip to content

Commit db91343

Browse files
authored
Merge branch 'main' into increase-mobile-devices-emulate
2 parents e395098 + 7765bb3 commit db91343

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"homepage": "https://github.com/ChromeDevTools/chrome-devtools-mcp#readme",
3737
"mcpName": "io.github.ChromeDevTools/chrome-devtools-mcp",
3838
"dependencies": {
39-
"@modelcontextprotocol/sdk": "1.18.1",
39+
"@modelcontextprotocol/sdk": "1.18.2",
4040
"debug": "4.4.3",
4141
"puppeteer-core": "24.22.3",
4242
"yargs": "18.0.0"

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)