|
1 | 1 | <!-- AUTO GENERATED DO NOT EDIT - run 'npm run gen' to update--> |
2 | 2 |
|
3 | | -# Chrome DevTools MCP Tool Reference (~6940 cl100k_base tokens) |
| 3 | +# Chrome DevTools MCP Tool Reference (~7262 cl100k_base tokens) |
4 | 4 |
|
5 | 5 | - **[Input automation](#input-automation)** (9 tools) |
6 | 6 | - [`click`](#click) |
|
30 | 30 | - **[Network](#network)** (2 tools) |
31 | 31 | - [`get_network_request`](#get_network_request) |
32 | 32 | - [`list_network_requests`](#list_network_requests) |
33 | | -- **[Debugging](#debugging)** (6 tools) |
| 33 | +- **[Debugging](#debugging)** (7 tools) |
34 | 34 | - [`evaluate_script`](#evaluate_script) |
| 35 | + - [`evaluate_script_file`](#evaluate_script_file) |
35 | 36 | - [`get_console_message`](#get_console_message) |
36 | 37 | - [`lighthouse_audit`](#lighthouse_audit) |
37 | 38 | - [`list_console_messages`](#list_console_messages) |
|
157 | 158 |
|
158 | 159 | ### `list_pages` |
159 | 160 |
|
160 | | -**Description:** Get a list of pages open in the browser. |
| 161 | +**Description:** Get a list of pages open in the browser. |
161 | 162 |
|
162 | 163 | **Parameters:** None |
163 | 164 |
|
@@ -323,19 +324,36 @@ so returned values have to be JSON-serializable. |
323 | 324 | **Parameters:** |
324 | 325 |
|
325 | 326 | - **function** (string) **(required)**: A JavaScript function declaration to be executed by the tool in the currently selected page. |
326 | | - Example without arguments: `() => { |
| 327 | +Example without arguments: `() => { |
327 | 328 | return document.title |
328 | 329 | }` or `async () => { |
329 | 330 | return await fetch("example.com") |
330 | 331 | }`. |
331 | | - Example with arguments: `(el) => { |
| 332 | +Example with arguments: `(el) => { |
332 | 333 | return el.innerText; |
333 | 334 | }` |
334 | 335 |
|
335 | 336 | - **args** (array) _(optional)_: An optional list of arguments to pass to the function. |
336 | 337 |
|
337 | 338 | --- |
338 | 339 |
|
| 340 | +### `evaluate_script_file` |
| 341 | + |
| 342 | +**Description:** Read a JavaScript file from the local filesystem and evaluate it inside the currently selected page. |
| 343 | +The file should contain a JavaScript function declaration (e.g., an arrow function or function expression). |
| 344 | +Returns the response as JSON, so returned values have to be JSON-serializable. |
| 345 | +This is useful for evaluating large scripts without needing to pass the entire script content as a parameter. |
| 346 | + |
| 347 | +**Parameters:** |
| 348 | + |
| 349 | +- **filePath** (string) **(required)**: The absolute path to a JavaScript file containing a function declaration to be executed in the currently selected page. |
| 350 | +The file content should be a JavaScript function declaration, for example: |
| 351 | +`() => { return document.title; }` or `async () => { return await fetch("example.com"); }` |
| 352 | + |
| 353 | +- **args** (array) _(optional)_: An optional list of arguments to pass to the function. |
| 354 | + |
| 355 | +--- |
| 356 | + |
339 | 357 | ### `get_console_message` |
340 | 358 |
|
341 | 359 | **Description:** Gets a console message by its ID. You can get all messages by calling [`list_console_messages`](#list_console_messages). |
|
0 commit comments