Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,9 @@ If you run into any issues, checkout our [troubleshooting guide](./docs/troubles
- **Network** (2 tools)
- [`get_network_request`](docs/tool-reference.md#get_network_request)
- [`list_network_requests`](docs/tool-reference.md#list_network_requests)
- **Debugging** (6 tools)
- **Debugging** (7 tools)
- [`evaluate_script`](docs/tool-reference.md#evaluate_script)
- [`evaluate_script_file`](docs/tool-reference.md#evaluate_script_file)
- [`get_console_message`](docs/tool-reference.md#get_console_message)
- [`lighthouse_audit`](docs/tool-reference.md#lighthouse_audit)
- [`list_console_messages`](docs/tool-reference.md#list_console_messages)
Expand Down
28 changes: 23 additions & 5 deletions docs/tool-reference.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- AUTO GENERATED DO NOT EDIT - run 'npm run gen' to update-->

# Chrome DevTools MCP Tool Reference (~6940 cl100k_base tokens)
# Chrome DevTools MCP Tool Reference (~7262 cl100k_base tokens)

- **[Input automation](#input-automation)** (9 tools)
- [`click`](#click)
Expand Down Expand Up @@ -30,8 +30,9 @@
- **[Network](#network)** (2 tools)
- [`get_network_request`](#get_network_request)
- [`list_network_requests`](#list_network_requests)
- **[Debugging](#debugging)** (6 tools)
- **[Debugging](#debugging)** (7 tools)
- [`evaluate_script`](#evaluate_script)
- [`evaluate_script_file`](#evaluate_script_file)
- [`get_console_message`](#get_console_message)
- [`lighthouse_audit`](#lighthouse_audit)
- [`list_console_messages`](#list_console_messages)
Expand Down Expand Up @@ -157,7 +158,7 @@

### `list_pages`

**Description:** Get a list of pages open in the browser.
**Description:** Get a list of pages open in the browser.

**Parameters:** None

Expand Down Expand Up @@ -323,19 +324,36 @@ so returned values have to be JSON-serializable.
**Parameters:**

- **function** (string) **(required)**: A JavaScript function declaration to be executed by the tool in the currently selected page.
Example without arguments: `() => {
Example without arguments: `() => {
return document.title
}` or `async () => {
return await fetch("example.com")
}`.
Example with arguments: `(el) => {
Example with arguments: `(el) => {
return el.innerText;
}`

- **args** (array) _(optional)_: An optional list of arguments to pass to the function.

---

### `evaluate_script_file`

**Description:** Read a JavaScript file from the local filesystem and evaluate it inside the currently selected page.
The file should contain a JavaScript function declaration (e.g., an arrow function or function expression).
Returns the response as JSON, so returned values have to be JSON-serializable.
This is useful for evaluating large scripts without needing to pass the entire script content as a parameter.

**Parameters:**

- **filePath** (string) **(required)**: The absolute path to a JavaScript file containing a function declaration to be executed in the currently selected page.
The file content should be a JavaScript function declaration, for example:
`() => { return document.title; }` or `async () => { return await fetch("example.com"); }`

- **args** (array) _(optional)_: An optional list of arguments to pass to the function.

---

### `get_console_message`

**Description:** Gets a console message by its ID. You can get all messages by calling [`list_console_messages`](#list_console_messages).
Expand Down
Loading