|
2 | 2 |
|
3 | 3 | # Chrome DevTools MCP Tool Reference |
4 | 4 |
|
5 | | -- **[Input automation](#input-automation)** (7 tools) |
6 | | - - [`click`](#click) |
7 | | - - [`drag`](#drag) |
8 | | - - [`fill`](#fill) |
9 | | - - [`fill_form`](#fill_form) |
10 | | - - [`handle_dialog`](#handle_dialog) |
11 | | - - [`hover`](#hover) |
12 | | - - [`upload_file`](#upload_file) |
13 | | -- **[Navigation automation](#navigation-automation)** (7 tools) |
| 5 | +- **[Core automation](#core-automation)** (10 tools) |
14 | 6 | - [`close_page`](#close_page) |
| 7 | + - [`handle_dialog`](#handle_dialog) |
15 | 8 | - [`list_pages`](#list_pages) |
16 | 9 | - [`navigate_page`](#navigate_page) |
17 | 10 | - [`navigate_page_history`](#navigate_page_history) |
18 | 11 | - [`new_page`](#new_page) |
19 | 12 | - [`select_page`](#select_page) |
| 13 | + - [`take_screenshot`](#take_screenshot) |
| 14 | + - [`take_snapshot`](#take_snapshot) |
20 | 15 | - [`wait_for`](#wait_for) |
| 16 | +- **[Input automation](#input-automation)** (6 tools) |
| 17 | + - [`click`](#click) |
| 18 | + - [`drag`](#drag) |
| 19 | + - [`fill`](#fill) |
| 20 | + - [`fill_form`](#fill_form) |
| 21 | + - [`hover`](#hover) |
| 22 | + - [`upload_file`](#upload_file) |
21 | 23 | - **[Emulation](#emulation)** (3 tools) |
22 | 24 | - [`emulate_cpu`](#emulate_cpu) |
23 | 25 | - [`emulate_network`](#emulate_network) |
|
29 | 31 | - **[Network](#network)** (2 tools) |
30 | 32 | - [`get_network_request`](#get_network_request) |
31 | 33 | - [`list_network_requests`](#list_network_requests) |
32 | | -- **[Debugging](#debugging)** (4 tools) |
| 34 | +- **[Debugging](#debugging)** (2 tools) |
33 | 35 | - [`evaluate_script`](#evaluate_script) |
34 | 36 | - [`list_console_messages`](#list_console_messages) |
35 | | - - [`take_screenshot`](#take_screenshot) |
36 | | - - [`take_snapshot`](#take_snapshot) |
37 | 37 |
|
38 | | -## Input automation |
| 38 | +## Core automation |
39 | 39 |
|
40 | | -### `click` |
| 40 | +### `close_page` |
41 | 41 |
|
42 | | -**Description:** Clicks on the provided element |
| 42 | +**Description:** Closes the page by its index. The last open page cannot be closed. |
43 | 43 |
|
44 | 44 | **Parameters:** |
45 | 45 |
|
46 | | -- **dblClick** (boolean) _(optional)_: Set to true for double clicks. Default is false. |
47 | | -- **uid** (string) **(required)**: The uid of an element on the page from the page content snapshot |
| 46 | +- **pageIdx** (number) **(required)**: The index of the page to close. Call [`list_pages`](#list_pages) to list pages. |
48 | 47 |
|
49 | 48 | --- |
50 | 49 |
|
51 | | -### `drag` |
| 50 | +### `handle_dialog` |
52 | 51 |
|
53 | | -**Description:** [`Drag`](#drag) an element onto another element |
| 52 | +**Description:** If a browser dialog was opened, use this command to handle it |
54 | 53 |
|
55 | 54 | **Parameters:** |
56 | 55 |
|
57 | | -- **from_uid** (string) **(required)**: The uid of the element to [`drag`](#drag) |
58 | | -- **to_uid** (string) **(required)**: The uid of the element to drop into |
| 56 | +- **action** (enum: "accept", "dismiss") **(required)**: Whether to dismiss or accept the dialog |
| 57 | +- **promptText** (string) _(optional)_: Optional prompt text to enter into the dialog. |
59 | 58 |
|
60 | 59 | --- |
61 | 60 |
|
62 | | -### `fill` |
| 61 | +### `list_pages` |
63 | 62 |
|
64 | | -**Description:** Type text into a input, text area or select an option from a <select> element. |
| 63 | +**Description:** Get a list of pages open in the browser. |
| 64 | + |
| 65 | +**Parameters:** None |
| 66 | + |
| 67 | +--- |
| 68 | + |
| 69 | +### `navigate_page` |
| 70 | + |
| 71 | +**Description:** Navigates the currently selected page to a URL. |
65 | 72 |
|
66 | 73 | **Parameters:** |
67 | 74 |
|
68 | | -- **uid** (string) **(required)**: The uid of an element on the page from the page content snapshot |
69 | | -- **value** (string) **(required)**: The value to [`fill`](#fill) in |
| 75 | +- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used. |
| 76 | +- **url** (string) **(required)**: URL to navigate the page to |
70 | 77 |
|
71 | 78 | --- |
72 | 79 |
|
73 | | -### `fill_form` |
| 80 | +### `navigate_page_history` |
74 | 81 |
|
75 | | -**Description:** [`Fill`](#fill) out multiple form elements at once |
| 82 | +**Description:** Navigates the currently selected page. |
76 | 83 |
|
77 | 84 | **Parameters:** |
78 | 85 |
|
79 | | -- **elements** (array) **(required)**: Elements from snapshot to [`fill`](#fill) out. |
| 86 | +- **navigate** (enum: "back", "forward") **(required)**: Whether to navigate back or navigate forward in the selected pages history |
| 87 | +- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used. |
80 | 88 |
|
81 | 89 | --- |
82 | 90 |
|
83 | | -### `handle_dialog` |
| 91 | +### `new_page` |
84 | 92 |
|
85 | | -**Description:** If a browser dialog was opened, use this command to handle it |
| 93 | +**Description:** Creates a new page |
86 | 94 |
|
87 | 95 | **Parameters:** |
88 | 96 |
|
89 | | -- **action** (enum: "accept", "dismiss") **(required)**: Whether to dismiss or accept the dialog |
90 | | -- **promptText** (string) _(optional)_: Optional prompt text to enter into the dialog. |
| 97 | +- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used. |
| 98 | +- **url** (string) **(required)**: URL to load in a new page. |
91 | 99 |
|
92 | 100 | --- |
93 | 101 |
|
94 | | -### `hover` |
| 102 | +### `select_page` |
95 | 103 |
|
96 | | -**Description:** [`Hover`](#hover) over the provided element |
| 104 | +**Description:** Select a page as a context for future tool calls. |
97 | 105 |
|
98 | 106 | **Parameters:** |
99 | 107 |
|
100 | | -- **uid** (string) **(required)**: The uid of an element on the page from the page content snapshot |
| 108 | +- **pageIdx** (number) **(required)**: The index of the page to select. Call [`list_pages`](#list_pages) to list pages. |
101 | 109 |
|
102 | 110 | --- |
103 | 111 |
|
104 | | -### `upload_file` |
| 112 | +### `take_screenshot` |
105 | 113 |
|
106 | | -**Description:** Upload a file through a provided element. |
| 114 | +**Description:** Take a screenshot of the page or element. |
107 | 115 |
|
108 | 116 | **Parameters:** |
109 | 117 |
|
110 | | -- **filePath** (string) **(required)**: The local path of the file to upload |
111 | | -- **uid** (string) **(required)**: The uid of the file input element or an element that will open file chooser on the page from the page content snapshot |
| 118 | +- **filePath** (string) _(optional)_: The absolute path, or a path relative to the current working directory, to save the screenshot to instead of attaching it to the response. |
| 119 | +- **format** (enum: "png", "jpeg", "webp") _(optional)_: Type of format to save the screenshot as. Default is "png" |
| 120 | +- **fullPage** (boolean) _(optional)_: If set to true takes a screenshot of the full page instead of the currently visible viewport. Incompatible with uid. |
| 121 | +- **quality** (number) _(optional)_: Compression quality for JPEG and WebP formats (0-100). Higher values mean better quality but larger file sizes. Ignored for PNG format. |
| 122 | +- **uid** (string) _(optional)_: The uid of an element on the page from the page content snapshot. If omitted takes a pages screenshot. |
112 | 123 |
|
113 | 124 | --- |
114 | 125 |
|
115 | | -## Navigation automation |
| 126 | +### `take_snapshot` |
116 | 127 |
|
117 | | -### `close_page` |
| 128 | +**Description:** Take a text snapshot of the currently selected page based on the a11y tree. The snapshot lists page elements along with a unique |
| 129 | +identifier (uid). Always use the latest snapshot. Prefer taking a snapshot over taking a screenshot. |
118 | 130 |
|
119 | | -**Description:** Closes the page by its index. The last open page cannot be closed. |
| 131 | +**Parameters:** |
| 132 | + |
| 133 | +- **verbose** (boolean) _(optional)_: Whether to include all possible information available in the full a11y tree. Default is false. |
| 134 | + |
| 135 | +--- |
| 136 | + |
| 137 | +### `wait_for` |
| 138 | + |
| 139 | +**Description:** Wait for the specified text to appear on the selected page. |
120 | 140 |
|
121 | 141 | **Parameters:** |
122 | 142 |
|
123 | | -- **pageIdx** (number) **(required)**: The index of the page to close. Call [`list_pages`](#list_pages) to list pages. |
| 143 | +- **text** (string) **(required)**: Text to appear on the page |
| 144 | +- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used. |
124 | 145 |
|
125 | 146 | --- |
126 | 147 |
|
127 | | -### `list_pages` |
| 148 | +## Input automation |
128 | 149 |
|
129 | | -**Description:** Get a list of pages open in the browser. |
| 150 | +### `click` |
130 | 151 |
|
131 | | -**Parameters:** None |
| 152 | +**Description:** Clicks on the provided element |
| 153 | + |
| 154 | +**Parameters:** |
| 155 | + |
| 156 | +- **dblClick** (boolean) _(optional)_: Set to true for double clicks. Default is false. |
| 157 | +- **uid** (string) **(required)**: The uid of an element on the page from the page content snapshot |
132 | 158 |
|
133 | 159 | --- |
134 | 160 |
|
135 | | -### `navigate_page` |
| 161 | +### `drag` |
136 | 162 |
|
137 | | -**Description:** Navigates the currently selected page to a URL. |
| 163 | +**Description:** [`Drag`](#drag) an element onto another element |
138 | 164 |
|
139 | 165 | **Parameters:** |
140 | 166 |
|
141 | | -- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used. |
142 | | -- **url** (string) **(required)**: URL to navigate the page to |
| 167 | +- **from_uid** (string) **(required)**: The uid of the element to [`drag`](#drag) |
| 168 | +- **to_uid** (string) **(required)**: The uid of the element to drop into |
143 | 169 |
|
144 | 170 | --- |
145 | 171 |
|
146 | | -### `navigate_page_history` |
| 172 | +### `fill` |
147 | 173 |
|
148 | | -**Description:** Navigates the currently selected page. |
| 174 | +**Description:** Type text into a input, text area or select an option from a <select> element. |
149 | 175 |
|
150 | 176 | **Parameters:** |
151 | 177 |
|
152 | | -- **navigate** (enum: "back", "forward") **(required)**: Whether to navigate back or navigate forward in the selected pages history |
153 | | -- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used. |
| 178 | +- **uid** (string) **(required)**: The uid of an element on the page from the page content snapshot |
| 179 | +- **value** (string) **(required)**: The value to [`fill`](#fill) in |
154 | 180 |
|
155 | 181 | --- |
156 | 182 |
|
157 | | -### `new_page` |
| 183 | +### `fill_form` |
158 | 184 |
|
159 | | -**Description:** Creates a new page |
| 185 | +**Description:** [`Fill`](#fill) out multiple form elements at once |
160 | 186 |
|
161 | 187 | **Parameters:** |
162 | 188 |
|
163 | | -- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used. |
164 | | -- **url** (string) **(required)**: URL to load in a new page. |
| 189 | +- **elements** (array) **(required)**: Elements from snapshot to [`fill`](#fill) out. |
165 | 190 |
|
166 | 191 | --- |
167 | 192 |
|
168 | | -### `select_page` |
| 193 | +### `hover` |
169 | 194 |
|
170 | | -**Description:** Select a page as a context for future tool calls. |
| 195 | +**Description:** [`Hover`](#hover) over the provided element |
171 | 196 |
|
172 | 197 | **Parameters:** |
173 | 198 |
|
174 | | -- **pageIdx** (number) **(required)**: The index of the page to select. Call [`list_pages`](#list_pages) to list pages. |
| 199 | +- **uid** (string) **(required)**: The uid of an element on the page from the page content snapshot |
175 | 200 |
|
176 | 201 | --- |
177 | 202 |
|
178 | | -### `wait_for` |
| 203 | +### `upload_file` |
179 | 204 |
|
180 | | -**Description:** Wait for the specified text to appear on the selected page. |
| 205 | +**Description:** Upload a file through a provided element. |
181 | 206 |
|
182 | 207 | **Parameters:** |
183 | 208 |
|
184 | | -- **text** (string) **(required)**: Text to appear on the page |
185 | | -- **timeout** (integer) _(optional)_: Maximum wait time in milliseconds. If set to 0, the default timeout will be used. |
| 209 | +- **filePath** (string) **(required)**: The local path of the file to upload |
| 210 | +- **uid** (string) **(required)**: The uid of the file input element or an element that will open file chooser on the page from the page content snapshot |
186 | 211 |
|
187 | 212 | --- |
188 | 213 |
|
@@ -303,28 +328,3 @@ so returned values have to JSON-serializable. |
303 | 328 | **Parameters:** None |
304 | 329 |
|
305 | 330 | --- |
306 | | - |
307 | | -### `take_screenshot` |
308 | | - |
309 | | -**Description:** Take a screenshot of the page or element. |
310 | | - |
311 | | -**Parameters:** |
312 | | - |
313 | | -- **filePath** (string) _(optional)_: The absolute path, or a path relative to the current working directory, to save the screenshot to instead of attaching it to the response. |
314 | | -- **format** (enum: "png", "jpeg", "webp") _(optional)_: Type of format to save the screenshot as. Default is "png" |
315 | | -- **fullPage** (boolean) _(optional)_: If set to true takes a screenshot of the full page instead of the currently visible viewport. Incompatible with uid. |
316 | | -- **quality** (number) _(optional)_: Compression quality for JPEG and WebP formats (0-100). Higher values mean better quality but larger file sizes. Ignored for PNG format. |
317 | | -- **uid** (string) _(optional)_: The uid of an element on the page from the page content snapshot. If omitted takes a pages screenshot. |
318 | | - |
319 | | ---- |
320 | | - |
321 | | -### `take_snapshot` |
322 | | - |
323 | | -**Description:** Take a text snapshot of the currently selected page based on the a11y tree. The snapshot lists page elements along with a unique |
324 | | -identifier (uid). Always use the latest snapshot. Prefer taking a snapshot over taking a screenshot. |
325 | | - |
326 | | -**Parameters:** |
327 | | - |
328 | | -- **verbose** (boolean) _(optional)_: Whether to include all possible information available in the full a11y tree. Default is false. |
329 | | - |
330 | | ---- |
0 commit comments