forked from ChromeDevTools/chrome-devtools-mcp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconsole.ts
More file actions
33 lines (30 loc) · 812 Bytes
/
console.ts
File metadata and controls
33 lines (30 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import z from 'zod';
import {ToolCategories} from './categories.js';
import {defineTool} from './ToolDefinition.js';
export const consoleTool = defineTool({
name: 'list_console_messages',
description: 'List all console messages for the currently selected page',
annotations: {
category: ToolCategories.DEBUGGING,
readOnlyHint: true,
},
schema: {
tail: z
.number()
.int()
.positive()
.optional()
.default(50)
.describe(
'Maximum number of recent messages to return. Defaults to 50. Omit or set to null to return all messages.',
),
},
handler: async (request, response) => {
response.setIncludeConsoleData(true, request.params.tail);
},
});