mcp-web-inspector 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1017 -0
  3. package/dist/evals/evals.d.ts +5 -0
  4. package/dist/evals/evals.js +41 -0
  5. package/dist/index.d.ts +2 -0
  6. package/dist/index.js +62 -0
  7. package/dist/requestHandler.d.ts +3 -0
  8. package/dist/requestHandler.js +53 -0
  9. package/dist/toolHandler.d.ts +91 -0
  10. package/dist/toolHandler.js +725 -0
  11. package/dist/tools/api/base.d.ts +33 -0
  12. package/dist/tools/api/base.js +49 -0
  13. package/dist/tools/api/index.d.ts +2 -0
  14. package/dist/tools/api/index.js +3 -0
  15. package/dist/tools/api/requests.d.ts +47 -0
  16. package/dist/tools/api/requests.js +168 -0
  17. package/dist/tools/browser/base.d.ts +51 -0
  18. package/dist/tools/browser/base.js +111 -0
  19. package/dist/tools/browser/cleanSession.d.ts +10 -0
  20. package/dist/tools/browser/cleanSession.js +42 -0
  21. package/dist/tools/browser/comparePositions.d.ts +11 -0
  22. package/dist/tools/browser/comparePositions.js +149 -0
  23. package/dist/tools/browser/computedStyles.d.ts +11 -0
  24. package/dist/tools/browser/computedStyles.js +128 -0
  25. package/dist/tools/browser/console.d.ts +37 -0
  26. package/dist/tools/browser/console.js +106 -0
  27. package/dist/tools/browser/elementExists.d.ts +9 -0
  28. package/dist/tools/browser/elementExists.js +57 -0
  29. package/dist/tools/browser/elementInspection.d.ts +21 -0
  30. package/dist/tools/browser/elementInspection.js +151 -0
  31. package/dist/tools/browser/elementPosition.d.ts +11 -0
  32. package/dist/tools/browser/elementPosition.js +107 -0
  33. package/dist/tools/browser/elementVisibility.d.ts +12 -0
  34. package/dist/tools/browser/elementVisibility.js +224 -0
  35. package/dist/tools/browser/findByText.d.ts +13 -0
  36. package/dist/tools/browser/findByText.js +207 -0
  37. package/dist/tools/browser/getRequestDetails.d.ts +9 -0
  38. package/dist/tools/browser/getRequestDetails.js +137 -0
  39. package/dist/tools/browser/getTestIds.d.ts +12 -0
  40. package/dist/tools/browser/getTestIds.js +148 -0
  41. package/dist/tools/browser/index.d.ts +7 -0
  42. package/dist/tools/browser/index.js +7 -0
  43. package/dist/tools/browser/inspectDom.d.ts +12 -0
  44. package/dist/tools/browser/inspectDom.js +447 -0
  45. package/dist/tools/browser/interaction.d.ts +104 -0
  46. package/dist/tools/browser/interaction.js +259 -0
  47. package/dist/tools/browser/listNetworkRequests.d.ts +10 -0
  48. package/dist/tools/browser/listNetworkRequests.js +74 -0
  49. package/dist/tools/browser/measureElement.d.ts +9 -0
  50. package/dist/tools/browser/measureElement.js +139 -0
  51. package/dist/tools/browser/navigation.d.ts +38 -0
  52. package/dist/tools/browser/navigation.js +109 -0
  53. package/dist/tools/browser/output.d.ts +11 -0
  54. package/dist/tools/browser/output.js +29 -0
  55. package/dist/tools/browser/querySelectorAll.d.ts +12 -0
  56. package/dist/tools/browser/querySelectorAll.js +201 -0
  57. package/dist/tools/browser/response.d.ts +29 -0
  58. package/dist/tools/browser/response.js +67 -0
  59. package/dist/tools/browser/screenshot.d.ts +16 -0
  60. package/dist/tools/browser/screenshot.js +70 -0
  61. package/dist/tools/browser/useragent.d.ts +15 -0
  62. package/dist/tools/browser/useragent.js +32 -0
  63. package/dist/tools/browser/visiblePage.d.ts +20 -0
  64. package/dist/tools/browser/visiblePage.js +170 -0
  65. package/dist/tools/browser/waitForElement.d.ts +10 -0
  66. package/dist/tools/browser/waitForElement.js +38 -0
  67. package/dist/tools/browser/waitForNetworkIdle.d.ts +8 -0
  68. package/dist/tools/browser/waitForNetworkIdle.js +32 -0
  69. package/dist/tools/codegen/generator.d.ts +21 -0
  70. package/dist/tools/codegen/generator.js +158 -0
  71. package/dist/tools/codegen/index.d.ts +11 -0
  72. package/dist/tools/codegen/index.js +187 -0
  73. package/dist/tools/codegen/recorder.d.ts +14 -0
  74. package/dist/tools/codegen/recorder.js +62 -0
  75. package/dist/tools/codegen/types.d.ts +28 -0
  76. package/dist/tools/codegen/types.js +1 -0
  77. package/dist/tools/common/types.d.ts +17 -0
  78. package/dist/tools/common/types.js +20 -0
  79. package/dist/tools/index.d.ts +2 -0
  80. package/dist/tools/index.js +2 -0
  81. package/dist/tools.d.ts +557 -0
  82. package/dist/tools.js +554 -0
  83. package/dist/types.d.ts +16 -0
  84. package/dist/types.js +1 -0
  85. package/package.json +60 -0
@@ -0,0 +1,557 @@
1
+ interface SessionConfig {
2
+ saveSession: boolean;
3
+ userDataDir: string;
4
+ screenshotsDir: string;
5
+ }
6
+ export declare function createToolDefinitions(sessionConfig?: SessionConfig): [{
7
+ readonly name: "navigate";
8
+ readonly description: string;
9
+ readonly inputSchema: {
10
+ readonly type: "object";
11
+ readonly properties: {
12
+ readonly url: {
13
+ readonly type: "string";
14
+ readonly description: "URL to navigate to the website specified";
15
+ };
16
+ readonly browserType: {
17
+ readonly type: "string";
18
+ readonly description: "Browser type to use (chromium, firefox, webkit). Defaults to chromium";
19
+ readonly enum: readonly ["chromium", "firefox", "webkit"];
20
+ };
21
+ readonly device: {
22
+ readonly type: "string";
23
+ readonly description: "Mobile device preset to emulate. Uses Playwright's built-in device configurations for viewport, user agent, and device scale factor. When specified, overrides width/height parameters.";
24
+ readonly enum: readonly ["iphone-se", "iphone-14", "iphone-14-pro", "pixel-5", "ipad", "samsung-s21"];
25
+ };
26
+ readonly width: {
27
+ readonly type: "number";
28
+ readonly description: "Viewport width in pixels (default: 1280). Ignored if device is specified.";
29
+ };
30
+ readonly height: {
31
+ readonly type: "number";
32
+ readonly description: "Viewport height in pixels (default: 720). Ignored if device is specified.";
33
+ };
34
+ readonly timeout: {
35
+ readonly type: "number";
36
+ readonly description: "Navigation timeout in milliseconds";
37
+ };
38
+ readonly waitUntil: {
39
+ readonly type: "string";
40
+ readonly description: "Navigation wait condition";
41
+ };
42
+ readonly headless: {
43
+ readonly type: "boolean";
44
+ readonly description: "Run browser in headless mode (default: false)";
45
+ };
46
+ };
47
+ readonly required: readonly ["url"];
48
+ };
49
+ }, {
50
+ readonly name: "screenshot";
51
+ readonly description: `Take a screenshot of the current page or a specific element. Screenshots are saved to ${string} by default. Example: { name: "login-page", fullPage: true } or { name: "submit-btn", selector: "testid:submit" }`;
52
+ readonly inputSchema: {
53
+ readonly type: "object";
54
+ readonly properties: {
55
+ readonly name: {
56
+ readonly type: "string";
57
+ readonly description: "Name for the screenshot file (without extension). Example: 'login-page' or 'error-state'";
58
+ };
59
+ readonly selector: {
60
+ readonly type: "string";
61
+ readonly description: "CSS selector or testid shorthand for element to screenshot. Example: '#submit-button' or 'testid:login-form'. Omit to capture full viewport.";
62
+ };
63
+ readonly fullPage: {
64
+ readonly type: "boolean";
65
+ readonly description: "Capture entire scrollable page instead of just viewport (default: false)";
66
+ };
67
+ readonly downloadsDir: {
68
+ readonly type: "string";
69
+ readonly description: `Custom directory for saving screenshot (default: ${string}). Example: './my-screenshots'`;
70
+ };
71
+ };
72
+ readonly required: readonly ["name"];
73
+ };
74
+ }, {
75
+ readonly name: "click";
76
+ readonly description: "Click an element on the page";
77
+ readonly inputSchema: {
78
+ readonly type: "object";
79
+ readonly properties: {
80
+ readonly selector: {
81
+ readonly type: "string";
82
+ readonly description: "CSS selector for the element to click";
83
+ };
84
+ };
85
+ readonly required: readonly ["selector"];
86
+ };
87
+ }, {
88
+ readonly name: "fill";
89
+ readonly description: "fill out an input field";
90
+ readonly inputSchema: {
91
+ readonly type: "object";
92
+ readonly properties: {
93
+ readonly selector: {
94
+ readonly type: "string";
95
+ readonly description: "CSS selector for input field";
96
+ };
97
+ readonly value: {
98
+ readonly type: "string";
99
+ readonly description: "Value to fill";
100
+ };
101
+ };
102
+ readonly required: readonly ["selector", "value"];
103
+ };
104
+ }, {
105
+ readonly name: "select";
106
+ readonly description: "Select an element on the page with Select tag";
107
+ readonly inputSchema: {
108
+ readonly type: "object";
109
+ readonly properties: {
110
+ readonly selector: {
111
+ readonly type: "string";
112
+ readonly description: "CSS selector for element to select";
113
+ };
114
+ readonly value: {
115
+ readonly type: "string";
116
+ readonly description: "Value to select";
117
+ };
118
+ };
119
+ readonly required: readonly ["selector", "value"];
120
+ };
121
+ }, {
122
+ readonly name: "hover";
123
+ readonly description: "Hover an element on the page";
124
+ readonly inputSchema: {
125
+ readonly type: "object";
126
+ readonly properties: {
127
+ readonly selector: {
128
+ readonly type: "string";
129
+ readonly description: "CSS selector for element to hover";
130
+ };
131
+ };
132
+ readonly required: readonly ["selector"];
133
+ };
134
+ }, {
135
+ readonly name: "upload_file";
136
+ readonly description: "Upload a file to an input[type='file'] element on the page";
137
+ readonly inputSchema: {
138
+ readonly type: "object";
139
+ readonly properties: {
140
+ readonly selector: {
141
+ readonly type: "string";
142
+ readonly description: "CSS selector for the file input element";
143
+ };
144
+ readonly filePath: {
145
+ readonly type: "string";
146
+ readonly description: "Absolute path to the file to upload";
147
+ };
148
+ };
149
+ readonly required: readonly ["selector", "filePath"];
150
+ };
151
+ }, {
152
+ readonly name: "evaluate";
153
+ readonly description: "Execute JavaScript in the browser console";
154
+ readonly inputSchema: {
155
+ readonly type: "object";
156
+ readonly properties: {
157
+ readonly script: {
158
+ readonly type: "string";
159
+ readonly description: "JavaScript code to execute";
160
+ };
161
+ };
162
+ readonly required: readonly ["script"];
163
+ };
164
+ }, {
165
+ readonly name: "get_console_logs";
166
+ readonly description: "Retrieve console logs from the browser with filtering options";
167
+ readonly inputSchema: {
168
+ readonly type: "object";
169
+ readonly properties: {
170
+ readonly type: {
171
+ readonly type: "string";
172
+ readonly description: "Type of logs to retrieve (all, error, warning, log, info, debug, exception)";
173
+ readonly enum: readonly ["all", "error", "warning", "log", "info", "debug", "exception"];
174
+ };
175
+ readonly search: {
176
+ readonly type: "string";
177
+ readonly description: "Text to search for in logs (handles text with square brackets)";
178
+ };
179
+ readonly limit: {
180
+ readonly type: "number";
181
+ readonly description: "Maximum number of logs to return";
182
+ };
183
+ readonly since: {
184
+ readonly type: "string";
185
+ readonly description: "Filter logs since a specific event: 'last-call' (since last get_console_logs call), 'last-navigation' (since last page navigation), or 'last-interaction' (since last user interaction like click, fill, etc.)";
186
+ readonly enum: readonly ["last-call", "last-navigation", "last-interaction"];
187
+ };
188
+ readonly clear: {
189
+ readonly type: "boolean";
190
+ readonly description: "Whether to clear logs after retrieval (default: false)";
191
+ };
192
+ };
193
+ readonly required: readonly [];
194
+ };
195
+ }, {
196
+ readonly name: "close";
197
+ readonly description: "Close the browser and release all resources";
198
+ readonly inputSchema: {
199
+ readonly type: "object";
200
+ readonly properties: {};
201
+ readonly required: readonly [];
202
+ };
203
+ }, {
204
+ readonly name: "get_text";
205
+ readonly description: "Get the visible text content of the current page";
206
+ readonly inputSchema: {
207
+ readonly type: "object";
208
+ readonly properties: {};
209
+ readonly required: readonly [];
210
+ };
211
+ }, {
212
+ readonly name: "get_html";
213
+ readonly description: "Get the HTML content of the current page. By default, all <script> tags are removed from the output unless removeScripts is explicitly set to false.";
214
+ readonly inputSchema: {
215
+ readonly type: "object";
216
+ readonly properties: {
217
+ readonly selector: {
218
+ readonly type: "string";
219
+ readonly description: "CSS selector to limit the HTML to a specific container";
220
+ };
221
+ readonly removeScripts: {
222
+ readonly type: "boolean";
223
+ readonly description: "Remove all script tags from the HTML (default: true)";
224
+ };
225
+ readonly removeComments: {
226
+ readonly type: "boolean";
227
+ readonly description: "Remove all HTML comments (default: false)";
228
+ };
229
+ readonly removeStyles: {
230
+ readonly type: "boolean";
231
+ readonly description: "Remove all style tags from the HTML (default: false)";
232
+ };
233
+ readonly removeMeta: {
234
+ readonly type: "boolean";
235
+ readonly description: "Remove all meta tags from the HTML (default: false)";
236
+ };
237
+ readonly cleanHtml: {
238
+ readonly type: "boolean";
239
+ readonly description: "Perform comprehensive HTML cleaning (default: false)";
240
+ };
241
+ readonly minify: {
242
+ readonly type: "boolean";
243
+ readonly description: "Minify the HTML output (default: false)";
244
+ };
245
+ readonly maxLength: {
246
+ readonly type: "number";
247
+ readonly description: "Maximum number of characters to return (default: 20000)";
248
+ };
249
+ };
250
+ readonly required: readonly [];
251
+ };
252
+ }, {
253
+ readonly name: "go_back";
254
+ readonly description: "Navigate back in browser history";
255
+ readonly inputSchema: {
256
+ readonly type: "object";
257
+ readonly properties: {};
258
+ readonly required: readonly [];
259
+ };
260
+ }, {
261
+ readonly name: "go_forward";
262
+ readonly description: "Navigate forward in browser history";
263
+ readonly inputSchema: {
264
+ readonly type: "object";
265
+ readonly properties: {};
266
+ readonly required: readonly [];
267
+ };
268
+ }, {
269
+ readonly name: "drag";
270
+ readonly description: "Drag an element to a target location";
271
+ readonly inputSchema: {
272
+ readonly type: "object";
273
+ readonly properties: {
274
+ readonly sourceSelector: {
275
+ readonly type: "string";
276
+ readonly description: "CSS selector for the element to drag";
277
+ };
278
+ readonly targetSelector: {
279
+ readonly type: "string";
280
+ readonly description: "CSS selector for the target location";
281
+ };
282
+ };
283
+ readonly required: readonly ["sourceSelector", "targetSelector"];
284
+ };
285
+ }, {
286
+ readonly name: "press_key";
287
+ readonly description: "Press a keyboard key";
288
+ readonly inputSchema: {
289
+ readonly type: "object";
290
+ readonly properties: {
291
+ readonly key: {
292
+ readonly type: "string";
293
+ readonly description: "Key to press (e.g. 'Enter', 'ArrowDown', 'a')";
294
+ };
295
+ readonly selector: {
296
+ readonly type: "string";
297
+ readonly description: "Optional CSS selector to focus before pressing key";
298
+ };
299
+ };
300
+ readonly required: readonly ["key"];
301
+ };
302
+ }, {
303
+ readonly name: "check_visibility";
304
+ readonly description: "Check if an element is visible to the user. CRITICAL for debugging click/interaction failures. Returns detailed visibility information including viewport intersection, clipping by overflow:hidden, and whether element needs scrolling. Supports testid shortcuts (e.g., 'testid:submit-button').";
305
+ readonly inputSchema: {
306
+ readonly type: "object";
307
+ readonly properties: {
308
+ readonly selector: {
309
+ readonly type: "string";
310
+ readonly description: "CSS selector, text selector, or testid shorthand (e.g., 'testid:login-button', '#submit', 'text=Click here')";
311
+ };
312
+ };
313
+ readonly required: readonly ["selector"];
314
+ };
315
+ }, {
316
+ readonly name: "get_position";
317
+ readonly description: "Get the position and size of an element. Returns x, y coordinates and width/height in pixels. Useful for finding where to click or checking element layout. Supports testid shortcuts (e.g., 'testid:submit-button').";
318
+ readonly inputSchema: {
319
+ readonly type: "object";
320
+ readonly properties: {
321
+ readonly selector: {
322
+ readonly type: "string";
323
+ readonly description: "CSS selector, text selector, or testid shorthand (e.g., 'testid:login-button', '#submit', 'text=Click here')";
324
+ };
325
+ };
326
+ readonly required: readonly ["selector"];
327
+ };
328
+ }, {
329
+ readonly name: "inspect_dom";
330
+ readonly description: "Progressive DOM inspection with semantic filtering and spatial layout info. This is the PRIMARY tool for understanding page structure. Returns immediate semantic children only (header, nav, main, form, button, elements with test IDs, ARIA roles, etc.) while automatically drilling through non-semantic wrapper elements (div, span, etc.) up to maxDepth levels. Use without selector for page overview, then drill down by calling again with a child's selector. Returns compact text format with position, visibility, and layout pattern detection. Supports testid shortcuts.";
331
+ readonly inputSchema: {
332
+ readonly type: "object";
333
+ readonly properties: {
334
+ readonly selector: {
335
+ readonly type: "string";
336
+ readonly description: "CSS selector, text selector, or testid shorthand to inspect. Omit for page overview (defaults to body). Use 'testid:login-form', '#main', etc.";
337
+ };
338
+ readonly includeHidden: {
339
+ readonly type: "boolean";
340
+ readonly description: "Include hidden elements in results (default: false)";
341
+ };
342
+ readonly maxChildren: {
343
+ readonly type: "number";
344
+ readonly description: "Maximum number of children to show (default: 20)";
345
+ };
346
+ readonly maxDepth: {
347
+ readonly type: "number";
348
+ readonly description: "Maximum depth to drill through non-semantic wrapper elements when looking for semantic children (default: 5). Increase for extremely deeply nested components, decrease to 1 to see only immediate children without drilling.";
349
+ };
350
+ };
351
+ readonly required: readonly [];
352
+ };
353
+ }, {
354
+ readonly name: "get_test_ids";
355
+ readonly description: "Discover all test identifiers on the page (data-testid, data-test, data-cy, etc.). Returns a compact text list grouped by attribute type. Essential for test-driven workflows and understanding what elements can be reliably selected. Use the returned test IDs with selector shortcuts like 'testid:submit-button'.";
356
+ readonly inputSchema: {
357
+ readonly type: "object";
358
+ readonly properties: {
359
+ readonly attributes: {
360
+ readonly type: "string";
361
+ readonly description: "Comma-separated list of test ID attributes to search for (default: 'data-testid,data-test,data-cy')";
362
+ };
363
+ readonly showAll: {
364
+ readonly type: "boolean";
365
+ readonly description: "If true, display all test IDs without truncation. If false (default), shows first 8 test IDs per attribute with a summary for longer lists.";
366
+ };
367
+ };
368
+ readonly required: readonly [];
369
+ };
370
+ }, {
371
+ readonly name: "query_selector";
372
+ readonly description: "Test a selector and return detailed information about all matched elements. Essential for selector debugging and finding the right element to interact with. Returns compact text format with element tag, position, text content, visibility status, and interaction capability. Shows why elements are hidden (display:none, opacity:0, zero size). Supports testid shortcuts (e.g., 'testid:submit-button'). Use limit parameter to control how many matches to show (default: 10). NEW: Use onlyVisible parameter to filter results (true=visible only, false=hidden only, undefined=all).";
373
+ readonly inputSchema: {
374
+ readonly type: "object";
375
+ readonly properties: {
376
+ readonly selector: {
377
+ readonly type: "string";
378
+ readonly description: "CSS selector, text selector, or testid shorthand to test (e.g., 'button.submit', 'testid:login-form', 'text=Sign In')";
379
+ };
380
+ readonly limit: {
381
+ readonly type: "number";
382
+ readonly description: "Maximum number of elements to return detailed info for (default: 10, recommended max: 50)";
383
+ };
384
+ readonly onlyVisible: {
385
+ readonly type: "boolean";
386
+ readonly description: "Filter results by visibility: true = show only visible elements, false = show only hidden elements, undefined/not specified = show all elements (default: undefined)";
387
+ };
388
+ readonly showAttributes: {
389
+ readonly type: "string";
390
+ readonly description: "Comma-separated list of HTML attributes to display for each element (e.g., 'id,name,aria-label,href,type'). If not specified, attributes are not shown.";
391
+ };
392
+ };
393
+ readonly required: readonly ["selector"];
394
+ };
395
+ }, {
396
+ readonly name: "find_by_text";
397
+ readonly description: "Find elements by their text content. Essential for finding elements without good selectors, especially in poorly structured DOM. Returns elements with position, visibility, and interaction state. Supports exact match, case-sensitive search, and NEW: regex pattern matching for advanced text searching (e.g., '/\\d+ items?/' to find elements with numbers).";
398
+ readonly inputSchema: {
399
+ readonly type: "object";
400
+ readonly properties: {
401
+ readonly text: {
402
+ readonly type: "string";
403
+ readonly description: "Text to search for in elements. If regex=true, this can be a regex pattern in /pattern/flags format (e.g., '/\\d+/i' for case-insensitive numbers) or a raw pattern string.";
404
+ };
405
+ readonly exact: {
406
+ readonly type: "boolean";
407
+ readonly description: "Whether to match text exactly (default: false, allows partial matches). Ignored if regex=true.";
408
+ };
409
+ readonly caseSensitive: {
410
+ readonly type: "boolean";
411
+ readonly description: "Whether search should be case-sensitive (default: false). Ignored if regex=true (use regex flags instead).";
412
+ };
413
+ readonly regex: {
414
+ readonly type: "boolean";
415
+ readonly description: "Whether to treat 'text' as a regex pattern (default: false). If true, supports /pattern/flags format or raw pattern. Examples: '/sign.*/i' (case-insensitive), '/\\d+ items?/' (numbers + optional 's').";
416
+ };
417
+ readonly limit: {
418
+ readonly type: "number";
419
+ readonly description: "Maximum number of elements to return (default: 10)";
420
+ };
421
+ };
422
+ readonly required: readonly ["text"];
423
+ };
424
+ }, {
425
+ readonly name: "get_computed_styles";
426
+ readonly description: "Get computed CSS styles for an element. Essential for understanding why elements behave unexpectedly and debugging layout issues. Returns styles grouped by category (Layout, Visibility, Spacing, Typography). Use properties parameter to request specific CSS properties, or omit for common layout properties.";
427
+ readonly inputSchema: {
428
+ readonly type: "object";
429
+ readonly properties: {
430
+ readonly selector: {
431
+ readonly type: "string";
432
+ readonly description: "CSS selector, text selector, or testid shorthand (e.g., 'testid:submit-button', '#main')";
433
+ };
434
+ readonly properties: {
435
+ readonly type: "string";
436
+ readonly description: "Comma-separated list of CSS properties to retrieve (e.g., 'display,width,color'). If not specified, returns common layout properties: display, position, width, height, opacity, visibility, z-index, overflow, margin, padding, font-size, font-weight, color, background-color";
437
+ };
438
+ };
439
+ readonly required: readonly ["selector"];
440
+ };
441
+ }, {
442
+ readonly name: "measure_element";
443
+ readonly description: "Get box model measurements (position, size, margin, padding, border) for an element. Use for layout debugging, spacing validation, and understanding CSS box model. Returns compact visual representation of content, padding, border, and margin with directional arrows.";
444
+ readonly inputSchema: {
445
+ readonly type: "object";
446
+ readonly properties: {
447
+ readonly selector: {
448
+ readonly type: "string";
449
+ readonly description: "CSS selector or testid shorthand (e.g., 'testid:submit', '#login-button')";
450
+ };
451
+ };
452
+ readonly required: readonly ["selector"];
453
+ };
454
+ }, {
455
+ readonly name: "element_exists";
456
+ readonly description: "Quick check if an element exists on the page. Ultra-lightweight alternative to query_selector_all when you only need existence confirmation. Returns simple exists/not found status. Most common check before attempting interaction. Supports testid shortcuts.";
457
+ readonly inputSchema: {
458
+ readonly type: "object";
459
+ readonly properties: {
460
+ readonly selector: {
461
+ readonly type: "string";
462
+ readonly description: "CSS selector, text selector, or testid shorthand (e.g., 'testid:submit-button', '#main')";
463
+ };
464
+ };
465
+ readonly required: readonly ["selector"];
466
+ };
467
+ }, {
468
+ readonly name: "compare_positions";
469
+ readonly description: "Compare positions and alignment of two elements. Validates layout consistency by checking if elements are aligned (top, left, right, bottom) or have the same dimensions (width, height). Essential for visual regression testing and ensuring consistent spacing across components. Returns compact text format with alignment status and difference in pixels.";
470
+ readonly inputSchema: {
471
+ readonly type: "object";
472
+ readonly properties: {
473
+ readonly selector1: {
474
+ readonly type: "string";
475
+ readonly description: "CSS selector, text selector, or testid shorthand for the first element (e.g., 'testid:main-header', '#header')";
476
+ };
477
+ readonly selector2: {
478
+ readonly type: "string";
479
+ readonly description: "CSS selector, text selector, or testid shorthand for the second element (e.g., 'testid:chat-header', '#secondary-header')";
480
+ };
481
+ readonly checkAlignment: {
482
+ readonly type: "string";
483
+ readonly description: "What to check: 'top', 'left', 'right', 'bottom' (edge alignment), or 'width', 'height' (dimension matching)";
484
+ readonly enum: readonly ["top", "left", "right", "bottom", "width", "height"];
485
+ };
486
+ };
487
+ readonly required: readonly ["selector1", "selector2", "checkAlignment"];
488
+ };
489
+ }, {
490
+ readonly name: "wait_for_element";
491
+ readonly description: "Wait for an element to reach a specific state (visible, hidden, attached, detached). Better than sleep() for waiting on dynamic content. Returns duration and current element status. Supports testid shortcuts (e.g., 'testid:submit-button').";
492
+ readonly inputSchema: {
493
+ readonly type: "object";
494
+ readonly properties: {
495
+ readonly selector: {
496
+ readonly type: "string";
497
+ readonly description: "CSS selector, text selector, or testid shorthand (e.g., 'testid:submit-button', '#loading-spinner')";
498
+ };
499
+ readonly state: {
500
+ readonly type: "string";
501
+ readonly description: "State to wait for: 'visible' (default), 'hidden', 'attached', 'detached'";
502
+ readonly enum: readonly ["visible", "hidden", "attached", "detached"];
503
+ };
504
+ readonly timeout: {
505
+ readonly type: "number";
506
+ readonly description: "Maximum time to wait in milliseconds (default: 10000)";
507
+ };
508
+ };
509
+ readonly required: readonly ["selector"];
510
+ };
511
+ }, {
512
+ readonly name: "wait_for_network_idle";
513
+ readonly description: "Wait for network activity to settle. Waits until there are no network connections for at least 500ms. Better than fixed delays when waiting for AJAX calls or dynamic content loading. Returns actual wait duration and confirmation of idle state.";
514
+ readonly inputSchema: {
515
+ readonly type: "object";
516
+ readonly properties: {
517
+ readonly timeout: {
518
+ readonly type: "number";
519
+ readonly description: "Maximum time to wait in milliseconds (default: 10000)";
520
+ };
521
+ };
522
+ readonly required: readonly [];
523
+ };
524
+ }, {
525
+ readonly name: "list_network_requests";
526
+ readonly description: "List recent network requests captured by the browser. Returns compact text format with method, URL, status, resource type, timing, and size. Essential for debugging API calls and performance issues. Use get_request_details() to inspect full headers and body for specific requests.";
527
+ readonly inputSchema: {
528
+ readonly type: "object";
529
+ readonly properties: {
530
+ readonly type: {
531
+ readonly type: "string";
532
+ readonly description: "Filter by resource type: 'xhr', 'fetch', 'script', 'stylesheet', 'image', 'font', 'document', etc. Omit to show all types.";
533
+ };
534
+ readonly limit: {
535
+ readonly type: "number";
536
+ readonly description: "Maximum number of requests to return, most recent first (default: 50)";
537
+ };
538
+ };
539
+ readonly required: readonly [];
540
+ };
541
+ }, {
542
+ readonly name: "get_request_details";
543
+ readonly description: "Get detailed information about a specific network request by index (from list_network_requests). Returns request/response headers, body (truncated at 500 chars), timing, and size. Request bodies with passwords are automatically masked. Essential for debugging API responses and investigating failed requests.";
544
+ readonly inputSchema: {
545
+ readonly type: "object";
546
+ readonly properties: {
547
+ readonly index: {
548
+ readonly type: "number";
549
+ readonly description: "Index of the request from list_network_requests output (e.g., [0], [1], etc.)";
550
+ };
551
+ };
552
+ readonly required: readonly ["index"];
553
+ };
554
+ }];
555
+ export declare const BROWSER_TOOLS: string[];
556
+ export declare const tools: string[];
557
+ export {};