chrometools-mcp 2.4.2 → 3.1.2
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.
- package/CHANGELOG.md +540 -0
- package/COMPONENT_MAPPING_SPEC.md +1217 -0
- package/README.md +494 -38
- package/bridge/bridge-client.js +472 -0
- package/bridge/bridge-service.js +399 -0
- package/bridge/install.js +241 -0
- package/browser/browser-manager.js +107 -2
- package/browser/page-manager.js +226 -69
- package/docs/CHROME_EXTENSION.md +219 -0
- package/docs/PAGE_OBJECT_MODEL_CONCEPT.md +1756 -0
- package/element-finder-utils.js +138 -28
- package/extension/background.js +643 -0
- package/extension/content.js +715 -0
- package/extension/icons/create-icons.js +164 -0
- package/extension/icons/icon128.png +0 -0
- package/extension/icons/icon16.png +0 -0
- package/extension/icons/icon48.png +0 -0
- package/extension/manifest.json +58 -0
- package/extension/popup/popup.css +437 -0
- package/extension/popup/popup.html +102 -0
- package/extension/popup/popup.js +415 -0
- package/extension/recorder-overlay.css +93 -0
- package/figma-tools.js +120 -0
- package/index.js +3347 -2518
- package/models/BaseInputModel.js +93 -0
- package/models/CheckboxGroupModel.js +199 -0
- package/models/CheckboxModel.js +103 -0
- package/models/ColorInputModel.js +53 -0
- package/models/DateInputModel.js +67 -0
- package/models/RadioGroupModel.js +126 -0
- package/models/RangeInputModel.js +60 -0
- package/models/SelectModel.js +97 -0
- package/models/TextInputModel.js +34 -0
- package/models/TextareaModel.js +59 -0
- package/models/TimeInputModel.js +49 -0
- package/models/index.js +122 -0
- package/package.json +3 -2
- package/pom/apom-converter.js +267 -0
- package/pom/apom-tree-converter.js +515 -0
- package/pom/element-id-generator.js +175 -0
- package/recorder/page-object-generator.js +16 -0
- package/recorder/scenario-executor.js +80 -2
- package/server/tool-definitions.js +839 -656
- package/server/tool-groups.js +3 -2
- package/server/tool-schemas.js +367 -296
- package/server/websocket-bridge.js +447 -0
- package/utils/selector-resolver.js +186 -0
- package/utils/ui-framework-detector.js +392 -0
|
@@ -1,656 +1,839 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* server/tool-definitions.js
|
|
3
|
-
*
|
|
4
|
-
* MCP tool definitions for ListTools handler
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export const toolDefinitions = [
|
|
8
|
-
{
|
|
9
|
-
name: "ping",
|
|
10
|
-
description: "Simple ping-pong tool for testing. Returns 'pong' with optional message.",
|
|
11
|
-
inputSchema: {
|
|
12
|
-
type: "object",
|
|
13
|
-
properties: {
|
|
14
|
-
message: { type: "string", description: "Optional message to include in response" },
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: "openBrowser",
|
|
20
|
-
description: "Open browser and navigate to URL. Window persists for further interactions.",
|
|
21
|
-
inputSchema: {
|
|
22
|
-
type: "object",
|
|
23
|
-
properties: {
|
|
24
|
-
url: { type: "string", description: "URL to navigate to" },
|
|
25
|
-
},
|
|
26
|
-
required: ["url"],
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: "click",
|
|
31
|
-
description: "
|
|
32
|
-
inputSchema: {
|
|
33
|
-
type: "object",
|
|
34
|
-
properties: {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: "type",
|
|
45
|
-
description: "
|
|
46
|
-
inputSchema: {
|
|
47
|
-
type: "object",
|
|
48
|
-
properties: {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
name: "
|
|
323
|
-
description: "
|
|
324
|
-
inputSchema: {
|
|
325
|
-
type: "object",
|
|
326
|
-
properties: {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
},
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
},
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
type: "string",
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
},
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
},
|
|
655
|
-
},
|
|
656
|
-
|
|
1
|
+
/**
|
|
2
|
+
* server/tool-definitions.js
|
|
3
|
+
*
|
|
4
|
+
* MCP tool definitions for ListTools handler
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const toolDefinitions = [
|
|
8
|
+
{
|
|
9
|
+
name: "ping",
|
|
10
|
+
description: "Simple ping-pong tool for testing. Returns 'pong' with optional message.",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
message: { type: "string", description: "Optional message to include in response" },
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "openBrowser",
|
|
20
|
+
description: "Open browser and navigate to URL. Window persists for further interactions.",
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
url: { type: "string", description: "URL to navigate to" },
|
|
25
|
+
},
|
|
26
|
+
required: ["url"],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "click",
|
|
31
|
+
description: "PRIMARY tool for clicking elements. PREFERRED: Use APOM ID (e.g., id: 'button_45') from analyzePage for reliable element targeting. ALTERNATIVE: CSS selector for ad-hoc usage. Works correctly with React/Vue/Angular synthetic events. DO NOT use executeScript for clicks - use this tool instead. Waits for animations and navigation.",
|
|
32
|
+
inputSchema: {
|
|
33
|
+
type: "object",
|
|
34
|
+
properties: {
|
|
35
|
+
id: { type: "string", description: "APOM element ID from analyzePage (e.g., 'button_45'). Either id or selector required." },
|
|
36
|
+
selector: { type: "string", description: "CSS selector (e.g., '.submit-btn'). Either id or selector required." },
|
|
37
|
+
waitAfter: { type: "number", description: "Wait ms (default: 1500)" },
|
|
38
|
+
screenshot: { type: "boolean", description: "Screenshot (default: false)" },
|
|
39
|
+
timeout: { type: "number", description: "Max wait ms (default: 30000)" },
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "type",
|
|
45
|
+
description: "PRIMARY tool for filling input fields. PREFERRED: Use APOM ID (e.g., id: 'input_20') from analyzePage for reliable element targeting. ALTERNATIVE: CSS selector for ad-hoc usage. Works correctly with React/Vue/Angular state management. DO NOT use executeScript for typing - use this tool instead. Automatically updates framework state (React hooks, Vue reactive data).",
|
|
46
|
+
inputSchema: {
|
|
47
|
+
type: "object",
|
|
48
|
+
properties: {
|
|
49
|
+
id: { type: "string", description: "APOM element ID from analyzePage (e.g., 'input_20'). Either id or selector required." },
|
|
50
|
+
selector: { type: "string", description: "CSS selector (e.g., '#email'). Either id or selector required." },
|
|
51
|
+
text: { type: "string", description: "Text to type" },
|
|
52
|
+
delay: { type: "number", description: "Keystroke delay ms (default: 0)" },
|
|
53
|
+
clearFirst: { type: "boolean", description: "Clear first (default: true)" },
|
|
54
|
+
},
|
|
55
|
+
required: ["text"],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "getElement",
|
|
60
|
+
description: "Get HTML markup of element. Prefer analyzePage for better efficiency.",
|
|
61
|
+
inputSchema: {
|
|
62
|
+
type: "object",
|
|
63
|
+
properties: {
|
|
64
|
+
selector: { type: "string", description: "CSS selector (default: body)" },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "getComputedCss",
|
|
70
|
+
description: "Get computed CSS styles for element. For layout debugging and responsive design.",
|
|
71
|
+
inputSchema: {
|
|
72
|
+
type: "object",
|
|
73
|
+
properties: {
|
|
74
|
+
selector: { type: "string", description: "CSS selector (default: body)" },
|
|
75
|
+
category: {
|
|
76
|
+
type: "string",
|
|
77
|
+
enum: ["all", "layout", "typography", "colors", "visual"],
|
|
78
|
+
description: "Filter: 'layout', 'typography', 'colors', 'visual', 'all' (default)"
|
|
79
|
+
},
|
|
80
|
+
properties: {
|
|
81
|
+
type: "array",
|
|
82
|
+
items: { type: "string" },
|
|
83
|
+
description: "Specific properties. Overrides category."
|
|
84
|
+
},
|
|
85
|
+
includeDefaults: {
|
|
86
|
+
type: "boolean",
|
|
87
|
+
description: "Include defaults (default: false)"
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "getBoxModel",
|
|
94
|
+
description: "Get element box model: dimensions, positioning, margins, padding, borders.",
|
|
95
|
+
inputSchema: {
|
|
96
|
+
type: "object",
|
|
97
|
+
properties: {
|
|
98
|
+
selector: { type: "string", description: "CSS selector" },
|
|
99
|
+
},
|
|
100
|
+
required: ["selector"],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "screenshot",
|
|
105
|
+
description: "Capture element image (15-25k tokens). For visual comparison. Use analyzePage for form data/validation (2-5k tokens).",
|
|
106
|
+
inputSchema: {
|
|
107
|
+
type: "object",
|
|
108
|
+
properties: {
|
|
109
|
+
selector: { type: "string", description: "CSS selector" },
|
|
110
|
+
padding: { type: "number", description: "Padding px (default: 0)" },
|
|
111
|
+
maxWidth: { type: "number", description: "Max width px (default: 1024, null=original)" },
|
|
112
|
+
maxHeight: { type: "number", description: "Max height px (default: 8000, null=original)" },
|
|
113
|
+
quality: { type: "number", minimum: 1, maximum: 100, description: "JPEG quality (default: 80)" },
|
|
114
|
+
format: { type: "string", enum: ["png", "jpeg", "auto"], description: "Format (default: auto)" },
|
|
115
|
+
},
|
|
116
|
+
required: ["selector"],
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: "saveScreenshot",
|
|
121
|
+
description: "Save screenshot to file without returning in context. Auto-scales and compresses. Use maxWidth: null and format: 'png' for original quality.",
|
|
122
|
+
inputSchema: {
|
|
123
|
+
type: "object",
|
|
124
|
+
properties: {
|
|
125
|
+
selector: { type: "string", description: "CSS selector" },
|
|
126
|
+
filePath: { type: "string", description: "Save path (extension auto-adjusted)" },
|
|
127
|
+
padding: { type: "number", description: "Padding px (default: 0)" },
|
|
128
|
+
maxWidth: { type: "number", description: "Max width px (default: 1024, null=original)" },
|
|
129
|
+
maxHeight: { type: "number", description: "Max height px (default: 8000, null=original)" },
|
|
130
|
+
quality: { type: "number", minimum: 1, maximum: 100, description: "JPEG quality (default: 80)" },
|
|
131
|
+
format: { type: "string", enum: ["png", "jpeg", "auto"], description: "Format (default: auto)" },
|
|
132
|
+
},
|
|
133
|
+
required: ["selector", "filePath"],
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: "scrollTo",
|
|
138
|
+
description: "Scroll to element. For lazy loading and visibility testing.",
|
|
139
|
+
inputSchema: {
|
|
140
|
+
type: "object",
|
|
141
|
+
properties: {
|
|
142
|
+
selector: { type: "string", description: "CSS selector" },
|
|
143
|
+
behavior: { type: "string", enum: ["auto", "smooth"], description: "Behavior (default: auto)" },
|
|
144
|
+
},
|
|
145
|
+
required: ["selector"],
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "waitForElement",
|
|
150
|
+
description: "Wait for element to appear. For dynamic content and lazy-loaded elements.",
|
|
151
|
+
inputSchema: {
|
|
152
|
+
type: "object",
|
|
153
|
+
properties: {
|
|
154
|
+
selector: { type: "string", description: "CSS selector" },
|
|
155
|
+
timeout: { type: "number", description: "Max wait ms (default: 5000)" },
|
|
156
|
+
visible: { type: "boolean", description: "Wait for visible (default: true)" },
|
|
157
|
+
},
|
|
158
|
+
required: ["selector"],
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "executeScript",
|
|
163
|
+
description: "⚠️ LAST RESORT tool - use ONLY when ALL specialized tools failed. NEVER use for: clicking (use click), typing (use type), reading page (use analyzePage), finding elements (use findElementsByText). May break React/Vue/Angular synthetic events. ALWAYS try specialized tools first.",
|
|
164
|
+
inputSchema: {
|
|
165
|
+
type: "object",
|
|
166
|
+
properties: {
|
|
167
|
+
script: { type: "string", description: "JavaScript code" },
|
|
168
|
+
waitAfter: { type: "number", description: "Wait ms (default: 500)" },
|
|
169
|
+
screenshot: { type: "boolean", description: "Screenshot (default: false)" },
|
|
170
|
+
timeout: { type: "number", description: "Max wait ms (default: 30000)" },
|
|
171
|
+
},
|
|
172
|
+
required: ["script"],
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "getConsoleLogs",
|
|
177
|
+
description: "Get browser console messages. For debugging JS errors and tracking behavior.",
|
|
178
|
+
inputSchema: {
|
|
179
|
+
type: "object",
|
|
180
|
+
properties: {
|
|
181
|
+
types: { type: "array", items: { type: "string", enum: ["log", "warn", "error", "info", "debug", "verbose", "warning"] }, description: "Filter types (default: all)" },
|
|
182
|
+
clear: { type: "boolean", description: "Clear after read (default: false)" },
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "listNetworkRequests",
|
|
188
|
+
description: "List network requests (method, URL, status). Use getNetworkRequest for details. Supports pagination.",
|
|
189
|
+
inputSchema: {
|
|
190
|
+
type: "object",
|
|
191
|
+
properties: {
|
|
192
|
+
types: { type: "array", items: { type: "string", enum: ["Document", "Stylesheet", "Image", "Media", "Font", "Script", "XHR", "Fetch", "WebSocket", "Other"] }, description: "Filter types (default: Fetch, XHR)" },
|
|
193
|
+
status: { type: "string", enum: ["pending", "completed", "failed", "all"], description: "Filter status (default: all)" },
|
|
194
|
+
limit: { type: "number", description: "Max requests (default: 50)" },
|
|
195
|
+
offset: { type: "number", description: "Skip requests (default: 0)" },
|
|
196
|
+
clear: { type: "boolean", description: "Clear after read (default: false)" },
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
name: "getNetworkRequest",
|
|
202
|
+
description: "Get network request details (headers, payload, response). Use requestId from listNetworkRequests.",
|
|
203
|
+
inputSchema: {
|
|
204
|
+
type: "object",
|
|
205
|
+
properties: {
|
|
206
|
+
requestId: { type: "string", description: "Request ID" },
|
|
207
|
+
},
|
|
208
|
+
required: ["requestId"],
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: "filterNetworkRequests",
|
|
213
|
+
description: "Filter network requests by URL pattern. Returns matching requests with full details.",
|
|
214
|
+
inputSchema: {
|
|
215
|
+
type: "object",
|
|
216
|
+
properties: {
|
|
217
|
+
urlPattern: { type: "string", description: "URL pattern (regex or partial)" },
|
|
218
|
+
types: { type: "array", items: { type: "string", enum: ["Document", "Stylesheet", "Image", "Media", "Font", "Script", "XHR", "Fetch", "WebSocket", "Other"] }, description: "Filter types (default: Fetch, XHR)" },
|
|
219
|
+
clear: { type: "boolean", description: "Clear after read (default: false)" },
|
|
220
|
+
},
|
|
221
|
+
required: ["urlPattern"],
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: "hover",
|
|
226
|
+
description: "Hover over element. PREFERRED: Use APOM ID from analyzePage. ALTERNATIVE: CSS selector. For testing hover effects, tooltips, and CSS :hover states.",
|
|
227
|
+
inputSchema: {
|
|
228
|
+
type: "object",
|
|
229
|
+
properties: {
|
|
230
|
+
id: { type: "string", description: "APOM element ID from analyzePage. Either id or selector required." },
|
|
231
|
+
selector: { type: "string", description: "CSS selector. Either id or selector required." },
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: "selectOption",
|
|
237
|
+
description: "Select option in dropdown. PREFERRED: Use APOM ID from analyzePage. ALTERNATIVE: CSS selector. Works with HTML select elements. Specify value, text, or index to choose option.",
|
|
238
|
+
inputSchema: {
|
|
239
|
+
type: "object",
|
|
240
|
+
properties: {
|
|
241
|
+
id: { type: "string", description: "APOM element ID from analyzePage for select element. Either id or selector required." },
|
|
242
|
+
selector: { type: "string", description: "CSS selector for select element. Either id or selector required." },
|
|
243
|
+
value: { type: "string", description: "Option value attribute (priority 1)" },
|
|
244
|
+
text: { type: "string", description: "Option text content (priority 2)" },
|
|
245
|
+
index: { type: "number", description: "Option index, 0-based (priority 3)" },
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: "drag",
|
|
251
|
+
description: "Drag element by mouse (click-hold-move-release). Simulates real mouse drag in any direction. Works with interactive maps, Gantt charts, SVG diagrams, canvas, sliders. Does NOT work with standard overflow scrollbars - use scrollTo/scrollHorizontal instead.",
|
|
252
|
+
inputSchema: {
|
|
253
|
+
type: "object",
|
|
254
|
+
properties: {
|
|
255
|
+
selector: { type: "string", description: "CSS selector for element to drag" },
|
|
256
|
+
direction: { type: "string", enum: ["up", "down", "left", "right", "up-left", "up-right", "down-left", "down-right"], description: "Drag direction" },
|
|
257
|
+
distance: { type: "number", description: "Distance in pixels (default: 100)" },
|
|
258
|
+
duration: { type: "number", description: "Drag duration in ms (default: 500)" },
|
|
259
|
+
},
|
|
260
|
+
required: ["selector", "direction"],
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: "scrollHorizontal",
|
|
265
|
+
description: "Scroll element horizontally. For tables, carousels, and horizontally scrollable containers. Can scroll by pixels or to the end.",
|
|
266
|
+
inputSchema: {
|
|
267
|
+
type: "object",
|
|
268
|
+
properties: {
|
|
269
|
+
selector: { type: "string", description: "CSS selector for element to scroll" },
|
|
270
|
+
direction: { type: "string", enum: ["left", "right"], description: "Scroll direction" },
|
|
271
|
+
amount: { description: "Pixels to scroll or 'full' for end" },
|
|
272
|
+
behavior: { type: "string", enum: ["auto", "smooth"], description: "Scroll behavior (default: auto)" },
|
|
273
|
+
},
|
|
274
|
+
required: ["selector", "direction", "amount"],
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
name: "setStyles",
|
|
279
|
+
description: "Apply inline CSS to element. For live editing and prototyping.",
|
|
280
|
+
inputSchema: {
|
|
281
|
+
type: "object",
|
|
282
|
+
properties: {
|
|
283
|
+
selector: { type: "string", description: "CSS selector" },
|
|
284
|
+
styles: {
|
|
285
|
+
type: "array",
|
|
286
|
+
items: {
|
|
287
|
+
type: "object",
|
|
288
|
+
properties: {
|
|
289
|
+
name: { type: "string", description: "Property name" },
|
|
290
|
+
value: { type: "string", description: "Property value" },
|
|
291
|
+
},
|
|
292
|
+
required: ["name", "value"],
|
|
293
|
+
},
|
|
294
|
+
description: "CSS property name-value pairs",
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
required: ["selector", "styles"],
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
name: "setViewport",
|
|
302
|
+
description: "Change viewport dimensions. Test responsive layouts across screen sizes.",
|
|
303
|
+
inputSchema: {
|
|
304
|
+
type: "object",
|
|
305
|
+
properties: {
|
|
306
|
+
width: { type: "number", minimum: 320, maximum: 4000, description: "Width px" },
|
|
307
|
+
height: { type: "number", minimum: 200, maximum: 3000, description: "Height px" },
|
|
308
|
+
deviceScaleFactor: { type: "number", minimum: 0.5, maximum: 3, description: "Pixel ratio (default: 1)" },
|
|
309
|
+
},
|
|
310
|
+
required: ["width", "height"],
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: "getViewport",
|
|
315
|
+
description: "Get viewport size and pixel ratio. For responsive design testing.",
|
|
316
|
+
inputSchema: {
|
|
317
|
+
type: "object",
|
|
318
|
+
properties: {},
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
name: "navigateTo",
|
|
323
|
+
description: "Navigate to new URL. Reuses browser instance.",
|
|
324
|
+
inputSchema: {
|
|
325
|
+
type: "object",
|
|
326
|
+
properties: {
|
|
327
|
+
url: { type: "string", description: "URL to navigate to" },
|
|
328
|
+
waitUntil: { type: "string", enum: ["load", "domcontentloaded", "networkidle0", "networkidle2"], description: "Wait event (default: networkidle2)" },
|
|
329
|
+
},
|
|
330
|
+
required: ["url"],
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
name: "getFigmaFrame",
|
|
335
|
+
description: "Export Figma frame as PNG. Requires API token and file/node IDs.",
|
|
336
|
+
inputSchema: {
|
|
337
|
+
type: "object",
|
|
338
|
+
properties: {
|
|
339
|
+
figmaToken: { type: "string", description: "API token (optional)" },
|
|
340
|
+
fileKey: { type: "string", description: "File key" },
|
|
341
|
+
nodeId: { type: "string", description: "Frame/component ID" },
|
|
342
|
+
scale: { type: "number", minimum: 0.1, maximum: 4, description: "Scale (default: 2)" },
|
|
343
|
+
format: { type: "string", enum: ["png", "jpg", "svg"], description: "Format (default: png)" },
|
|
344
|
+
},
|
|
345
|
+
required: ["fileKey", "nodeId"],
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: "compareFigmaToElement",
|
|
350
|
+
description: "Compare Figma design with browser element. Pixel-perfect validation.",
|
|
351
|
+
inputSchema: {
|
|
352
|
+
type: "object",
|
|
353
|
+
properties: {
|
|
354
|
+
figmaToken: { type: "string", description: "API token (optional)" },
|
|
355
|
+
fileKey: { type: "string", description: "File key" },
|
|
356
|
+
nodeId: { type: "string", description: "Frame/component ID" },
|
|
357
|
+
selector: { type: "string", description: "CSS selector" },
|
|
358
|
+
threshold: { type: "number", minimum: 0, maximum: 1, description: "Diff threshold (default: 0.05)" },
|
|
359
|
+
figmaScale: { type: "number", minimum: 0.1, maximum: 4, description: "Scale (default: 2)" },
|
|
360
|
+
},
|
|
361
|
+
required: ["fileKey", "nodeId", "selector"],
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
name: "getFigmaSpecs",
|
|
366
|
+
description: "Extract design specs from Figma: colors, fonts, dimensions, spacing.",
|
|
367
|
+
inputSchema: {
|
|
368
|
+
type: "object",
|
|
369
|
+
properties: {
|
|
370
|
+
figmaToken: { type: "string", description: "API token (optional)" },
|
|
371
|
+
fileKey: { type: "string", description: "File key" },
|
|
372
|
+
nodeId: { type: "string", description: "Frame/component ID" },
|
|
373
|
+
},
|
|
374
|
+
required: ["fileKey", "nodeId"],
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
name: "parseFigmaUrl",
|
|
379
|
+
description: "Parse Figma URL to extract fileKey and nodeId.",
|
|
380
|
+
inputSchema: {
|
|
381
|
+
type: "object",
|
|
382
|
+
properties: {
|
|
383
|
+
url: { type: "string", description: "Figma URL or fileKey" },
|
|
384
|
+
},
|
|
385
|
+
required: ["url"],
|
|
386
|
+
},
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
name: "listFigmaPages",
|
|
390
|
+
description: "Get file structure: all pages and frames. Use first to discover file contents.",
|
|
391
|
+
inputSchema: {
|
|
392
|
+
type: "object",
|
|
393
|
+
properties: {
|
|
394
|
+
figmaToken: { type: "string", description: "API token (optional)" },
|
|
395
|
+
fileKey: { type: "string", description: "File key or URL" },
|
|
396
|
+
},
|
|
397
|
+
required: ["fileKey"],
|
|
398
|
+
},
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
name: "searchFigmaFrames",
|
|
402
|
+
description: "Search frames/components by name. Case-insensitive across all pages.",
|
|
403
|
+
inputSchema: {
|
|
404
|
+
type: "object",
|
|
405
|
+
properties: {
|
|
406
|
+
figmaToken: { type: "string", description: "API token (optional)" },
|
|
407
|
+
fileKey: { type: "string", description: "File key or URL" },
|
|
408
|
+
searchQuery: { type: "string", description: "Search query" },
|
|
409
|
+
},
|
|
410
|
+
required: ["fileKey", "searchQuery"],
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
name: "getFigmaComponents",
|
|
415
|
+
description: "Get all components from file (Design System). For extracting design system.",
|
|
416
|
+
inputSchema: {
|
|
417
|
+
type: "object",
|
|
418
|
+
properties: {
|
|
419
|
+
figmaToken: { type: "string", description: "API token (optional)" },
|
|
420
|
+
fileKey: { type: "string", description: "File key or URL" },
|
|
421
|
+
},
|
|
422
|
+
required: ["fileKey"],
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: "getFigmaStyles",
|
|
427
|
+
description: "Get all styles: color, text, effect, grid. For extracting design tokens.",
|
|
428
|
+
inputSchema: {
|
|
429
|
+
type: "object",
|
|
430
|
+
properties: {
|
|
431
|
+
figmaToken: { type: "string", description: "API token (optional)" },
|
|
432
|
+
fileKey: { type: "string", description: "File key or URL" },
|
|
433
|
+
},
|
|
434
|
+
required: ["fileKey"],
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
name: "getFigmaColorPalette",
|
|
439
|
+
description: "Extract color palette. Returns unique colors with hex, rgba, usage count.",
|
|
440
|
+
inputSchema: {
|
|
441
|
+
type: "object",
|
|
442
|
+
properties: {
|
|
443
|
+
figmaToken: { type: "string", description: "API token (optional)" },
|
|
444
|
+
fileKey: { type: "string", description: "File key or URL" },
|
|
445
|
+
},
|
|
446
|
+
required: ["fileKey"],
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
name: "convertFigmaToCode",
|
|
451
|
+
description: "Convert Figma design to React/Tailwind code. Fetches node structure and rendered image, returns simplified design data with AI instructions for generating clean, semantic code. Focuses on React components with Tailwind CSS styling.",
|
|
452
|
+
inputSchema: {
|
|
453
|
+
type: "object",
|
|
454
|
+
properties: {
|
|
455
|
+
figmaToken: { type: "string", description: "API token (optional)" },
|
|
456
|
+
fileKey: { type: "string", description: "File key" },
|
|
457
|
+
nodeId: { type: "string", description: "Frame/component ID (formats: '123:456' or '123-456')" },
|
|
458
|
+
framework: { type: "string", enum: ["react", "react-typescript", "html"], description: "Target framework (default: react)" },
|
|
459
|
+
includeComments: { type: "boolean", description: "Include comments (default: true)" },
|
|
460
|
+
},
|
|
461
|
+
required: ["fileKey", "nodeId"],
|
|
462
|
+
},
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
name: "smartFindElement",
|
|
466
|
+
description: "Find elements with natural language. Returns ranked candidates. Prefer analyzePage for better performance.",
|
|
467
|
+
inputSchema: {
|
|
468
|
+
type: "object",
|
|
469
|
+
properties: {
|
|
470
|
+
description: { type: "string", description: "Natural language description" },
|
|
471
|
+
maxResults: { type: "number", minimum: 1, maximum: 20, description: "Max candidates (default: 5)" },
|
|
472
|
+
action: {
|
|
473
|
+
type: "object",
|
|
474
|
+
properties: {
|
|
475
|
+
type: { type: "string", enum: ["click", "type", "scrollTo", "screenshot", "hover", "setStyles"], description: "Action type" },
|
|
476
|
+
text: { type: "string", description: "Text for 'type'" },
|
|
477
|
+
styles: { type: "array", items: { type: "object", properties: { name: { type: "string" }, value: { type: "string" } } }, description: "Styles for 'setStyles'" },
|
|
478
|
+
screenshot: { type: "boolean", description: "Screenshot (default: false)" },
|
|
479
|
+
waitAfter: { type: "number", description: "Wait ms" },
|
|
480
|
+
},
|
|
481
|
+
required: ["type"],
|
|
482
|
+
description: "Optional action on element",
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
required: ["description"],
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
name: "analyzePage",
|
|
490
|
+
description: "PRIMARY tool for reading page state. Returns APOM (Agent Page Object Model) format by default with unique element IDs. Use element IDs with click/type tools instead of CSS selectors. Use refresh:true after clicks/submissions to see updated state. Efficient: 2-5k tokens vs screenshot 15-25k. Set useLegacyFormat:true for old format.",
|
|
491
|
+
inputSchema: {
|
|
492
|
+
type: "object",
|
|
493
|
+
properties: {
|
|
494
|
+
refresh: { type: "boolean", description: "Refresh cache (default: false)" },
|
|
495
|
+
includeAll: { type: "boolean", description: "Include all elements on page, not just interactive ones (default: false)" },
|
|
496
|
+
useLegacyFormat: { type: "boolean", description: "Return legacy format instead of APOM (default: false - APOM is now default)" },
|
|
497
|
+
registerElements: { type: "boolean", description: "Auto-register elements in selector resolver (default: true)" },
|
|
498
|
+
groupBy: { type: "string", description: "Group elements: 'type' or 'flat' (default: 'type')", enum: ["type", "flat"] },
|
|
499
|
+
},
|
|
500
|
+
},
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
name: "getElementByApomId",
|
|
504
|
+
description: "Get detailed information about element by its APOM ID from analyzePage. Returns full element details including bounds, position, attributes, computed styles. Use this to inspect specific elements without re-analyzing entire page.",
|
|
505
|
+
inputSchema: {
|
|
506
|
+
type: "object",
|
|
507
|
+
properties: {
|
|
508
|
+
id: { type: "string", description: "APOM element ID (e.g., 'input_20', 'button_45') from analyzePage result" },
|
|
509
|
+
},
|
|
510
|
+
required: ["id"],
|
|
511
|
+
},
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
name: "getAllInteractiveElements",
|
|
515
|
+
description: "Get all interactive elements with selectors. For understanding available actions.",
|
|
516
|
+
inputSchema: {
|
|
517
|
+
type: "object",
|
|
518
|
+
properties: {
|
|
519
|
+
includeHidden: { type: "boolean", description: "Include hidden (default: false)" },
|
|
520
|
+
},
|
|
521
|
+
},
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
name: "findElementsByText",
|
|
525
|
+
description: "Find elements by visible text content and get their selectors. Use this INSTEAD of executeScript when you need to find elements. Returns working selectors that can be used with click/type tools. Can optionally perform actions directly.",
|
|
526
|
+
inputSchema: {
|
|
527
|
+
type: "object",
|
|
528
|
+
properties: {
|
|
529
|
+
text: { type: "string", description: "Search text" },
|
|
530
|
+
exact: { type: "boolean", description: "Exact match (default: false)" },
|
|
531
|
+
caseSensitive: { type: "boolean", description: "Case sensitive (default: false)" },
|
|
532
|
+
action: {
|
|
533
|
+
type: "object",
|
|
534
|
+
properties: {
|
|
535
|
+
type: { type: "string", enum: ["click", "type", "scrollTo", "screenshot", "hover", "setStyles"], description: "Action type" },
|
|
536
|
+
text: { type: "string", description: "Text for 'type'" },
|
|
537
|
+
styles: { type: "array", items: { type: "object", properties: { name: { type: "string" }, value: { type: "string" } } }, description: "Styles for 'setStyles'" },
|
|
538
|
+
screenshot: { type: "boolean", description: "Screenshot (default: false)" },
|
|
539
|
+
waitAfter: { type: "number", description: "Wait ms" },
|
|
540
|
+
},
|
|
541
|
+
required: ["type"],
|
|
542
|
+
description: "Optional action on first match",
|
|
543
|
+
},
|
|
544
|
+
},
|
|
545
|
+
required: ["text"],
|
|
546
|
+
},
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
name: "selectFromGroup",
|
|
550
|
+
description: "Select option(s) from radio or checkbox group by name attribute. For radio groups: selects one option. For checkbox groups: supports multi-select with modes (set/add/remove/toggle). Use 'name' to identify the group, and 'value'/'text' to select by value or label. See groups in analyzePage output for available options.",
|
|
551
|
+
inputSchema: {
|
|
552
|
+
type: "object",
|
|
553
|
+
properties: {
|
|
554
|
+
name: { type: "string", description: "Name attribute of the radio/checkbox group (e.g., 'size', 'topping')" },
|
|
555
|
+
value: { type: "string", description: "Single value to select (for radio or single checkbox)" },
|
|
556
|
+
values: { type: "array", items: { type: "string" }, description: "Multiple values to select (for checkbox group)" },
|
|
557
|
+
text: { type: "string", description: "Label text to match (alternative to value)" },
|
|
558
|
+
texts: { type: "array", items: { type: "string" }, description: "Multiple label texts to match (for checkbox group)" },
|
|
559
|
+
mode: { type: "string", enum: ["set", "add", "remove", "toggle"], description: "For checkboxes: 'set' (replace all), 'add', 'remove', 'toggle' (default: 'set')" },
|
|
560
|
+
by: { type: "string", enum: ["value", "text", "auto"], description: "Match by value, label text, or auto-detect (default: 'auto')" },
|
|
561
|
+
},
|
|
562
|
+
required: ["name"],
|
|
563
|
+
},
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
name: "enableRecorder",
|
|
567
|
+
description: "Check ChromeTools Extension connection status for scenario recording. Recording is now handled via Chrome Extension popup (click CT icon in Chrome toolbar). Scenarios are stored in ~/.config/chrometools-mcp/projects/{projectName}/scenarios/.",
|
|
568
|
+
inputSchema: {
|
|
569
|
+
type: "object",
|
|
570
|
+
properties: {},
|
|
571
|
+
},
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
name: "startRecording",
|
|
575
|
+
description: "Start recording user actions into a scenario. Recording follows the active tab automatically. Use stopRecording to finish and save the scenario.",
|
|
576
|
+
inputSchema: {
|
|
577
|
+
type: "object",
|
|
578
|
+
properties: {
|
|
579
|
+
name: {
|
|
580
|
+
type: "string",
|
|
581
|
+
description: "Scenario name (optional, can be set later when saving)",
|
|
582
|
+
},
|
|
583
|
+
description: {
|
|
584
|
+
type: "string",
|
|
585
|
+
description: "Scenario description (optional)",
|
|
586
|
+
},
|
|
587
|
+
tags: {
|
|
588
|
+
type: "array",
|
|
589
|
+
items: { type: "string" },
|
|
590
|
+
description: "Tags for organizing scenarios (optional)",
|
|
591
|
+
},
|
|
592
|
+
},
|
|
593
|
+
},
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
name: "stopRecording",
|
|
597
|
+
description: "Stop recording and return recorded actions. Does not save the scenario - use this to review actions before saving with saveScenario.",
|
|
598
|
+
inputSchema: {
|
|
599
|
+
type: "object",
|
|
600
|
+
properties: {},
|
|
601
|
+
},
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
name: "getRecorderState",
|
|
605
|
+
description: "Get current recorder state: isRecording, isPaused, action count, current tab",
|
|
606
|
+
inputSchema: {
|
|
607
|
+
type: "object",
|
|
608
|
+
properties: {},
|
|
609
|
+
},
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
name: "saveScenario",
|
|
613
|
+
description: "Save recorded actions as a scenario. Call this after stopRecording to persist the scenario to disk.",
|
|
614
|
+
inputSchema: {
|
|
615
|
+
type: "object",
|
|
616
|
+
properties: {
|
|
617
|
+
name: {
|
|
618
|
+
type: "string",
|
|
619
|
+
description: "Scenario name",
|
|
620
|
+
},
|
|
621
|
+
description: {
|
|
622
|
+
type: "string",
|
|
623
|
+
description: "Scenario description (optional)",
|
|
624
|
+
},
|
|
625
|
+
tags: {
|
|
626
|
+
type: "array",
|
|
627
|
+
items: { type: "string" },
|
|
628
|
+
description: "Tags for organizing scenarios (optional)",
|
|
629
|
+
},
|
|
630
|
+
actions: {
|
|
631
|
+
type: "array",
|
|
632
|
+
description: "Array of recorded actions (from stopRecording)",
|
|
633
|
+
},
|
|
634
|
+
secrets: {
|
|
635
|
+
type: "object",
|
|
636
|
+
description: "Secrets object (from stopRecording)",
|
|
637
|
+
},
|
|
638
|
+
},
|
|
639
|
+
required: ["name", "actions"],
|
|
640
|
+
},
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
name: "executeScenario",
|
|
644
|
+
description: "Execute recorded scenario by name. Runs actions with dependency resolution. Scenarios are organized by domain in ~/.config/chrometools-mcp/projects/{domain}/scenarios/. If multiple scenarios have the same name across different domains, specify projectId to disambiguate.",
|
|
645
|
+
inputSchema: {
|
|
646
|
+
type: "object",
|
|
647
|
+
properties: {
|
|
648
|
+
name: { type: "string", description: "Scenario name" },
|
|
649
|
+
projectId: { type: "string", description: "Optional: Project ID (domain) to disambiguate scenarios with same name. Examples: 'google', 'localhost-3000'" },
|
|
650
|
+
parameters: { type: "object", description: "Execution parameters" },
|
|
651
|
+
executeDependencies: { type: "boolean", description: "Execute dependencies (default: true)" },
|
|
652
|
+
},
|
|
653
|
+
required: ["name"],
|
|
654
|
+
},
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
name: "listScenarios",
|
|
658
|
+
description: "List all scenarios with metadata. Scenarios are stored in ~/.config/chrometools-mcp/projects/{projectName}/scenarios/. Use global index at ~/.config/chrometools-mcp/index.json to discover available projects and scenarios.",
|
|
659
|
+
inputSchema: {
|
|
660
|
+
type: "object",
|
|
661
|
+
properties: {
|
|
662
|
+
allProjects: { type: "boolean", description: "List scenarios from all projects (default: false, shows only current project)" },
|
|
663
|
+
},
|
|
664
|
+
},
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
name: "searchScenarios",
|
|
668
|
+
description: "Search scenarios by text or tags. Scenarios are stored in ~/.config/chrometools-mcp/projects/{projectName}/scenarios/. Use global index at ~/.config/chrometools-mcp/index.json to discover available projects and scenarios.",
|
|
669
|
+
inputSchema: {
|
|
670
|
+
type: "object",
|
|
671
|
+
properties: {
|
|
672
|
+
text: { type: "string", description: "Search text" },
|
|
673
|
+
tags: { type: "array", items: { type: "string" }, description: "Filter tags" },
|
|
674
|
+
allProjects: { type: "boolean", description: "Search in all projects (default: false, searches only current project)" },
|
|
675
|
+
},
|
|
676
|
+
},
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
name: "getScenarioInfo",
|
|
680
|
+
description: "Get scenario details: actions, parameters, dependencies. Scenarios are stored in ~/.config/chrometools-mcp/projects/{projectName}/scenarios/. Use global index at ~/.config/chrometools-mcp/index.json to discover available projects and scenarios.",
|
|
681
|
+
inputSchema: {
|
|
682
|
+
type: "object",
|
|
683
|
+
properties: {
|
|
684
|
+
name: { type: "string", description: "Scenario name" },
|
|
685
|
+
includeSecrets: { type: "boolean", description: "Include secrets (default: false)" },
|
|
686
|
+
},
|
|
687
|
+
required: ["name"],
|
|
688
|
+
},
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
name: "deleteScenario",
|
|
692
|
+
description: "Delete scenario and secrets. Scenarios are stored in ~/.config/chrometools-mcp/projects/{projectName}/scenarios/. Use global index at ~/.config/chrometools-mcp/index.json to discover available projects and scenarios.",
|
|
693
|
+
inputSchema: {
|
|
694
|
+
type: "object",
|
|
695
|
+
properties: {
|
|
696
|
+
name: { type: "string", description: "Scenario name" },
|
|
697
|
+
},
|
|
698
|
+
required: ["name"],
|
|
699
|
+
},
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
name: "exportScenarioAsCode",
|
|
703
|
+
description: "Export recorded scenario as executable test code for creating a NEW test file. Automatically cleans unstable selectors (CSS modules, styled-components). Optionally generates Page Object class. Returns JSON with code and suggested filename - Claude Code will create the file. To add tests to EXISTING files, use 'appendScenarioToFile' instead. Scenarios are stored in ~/.config/chrometools-mcp/projects/{projectName}/scenarios/. Use global index at ~/.config/chrometools-mcp/index.json to discover available projects and scenarios.",
|
|
704
|
+
inputSchema: {
|
|
705
|
+
type: "object",
|
|
706
|
+
properties: {
|
|
707
|
+
scenarioName: {
|
|
708
|
+
type: "string",
|
|
709
|
+
description: "Name of scenario to export"
|
|
710
|
+
},
|
|
711
|
+
language: {
|
|
712
|
+
type: "string",
|
|
713
|
+
enum: ["playwright-typescript", "playwright-python", "selenium-python", "selenium-java"],
|
|
714
|
+
description: "Target test framework and language"
|
|
715
|
+
},
|
|
716
|
+
cleanSelectors: {
|
|
717
|
+
type: "boolean",
|
|
718
|
+
description: "Remove unstable CSS classes (default: true)"
|
|
719
|
+
},
|
|
720
|
+
includeComments: {
|
|
721
|
+
type: "boolean",
|
|
722
|
+
description: "Include descriptive comments (default: true)"
|
|
723
|
+
},
|
|
724
|
+
generatePageObject: {
|
|
725
|
+
type: "boolean",
|
|
726
|
+
description: "Also generate Page Object class for the page (default: false)"
|
|
727
|
+
},
|
|
728
|
+
pageObjectClassName: {
|
|
729
|
+
type: "string",
|
|
730
|
+
description: "Page Object class name (optional, auto-generated if not provided)"
|
|
731
|
+
},
|
|
732
|
+
},
|
|
733
|
+
required: ["scenarioName", "language"],
|
|
734
|
+
},
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
name: "appendScenarioToFile",
|
|
738
|
+
description: "Append recorded scenario as test code to an EXISTING test file. Automatically cleans unstable selectors (CSS modules, styled-components). Optionally generates Page Object class. Returns JSON with test code and target file - Claude Code will append to the file without overwriting existing tests. To create NEW test files, use 'exportScenarioAsCode' instead. Scenarios are stored in ~/.config/chrometools-mcp/projects/{projectName}/scenarios/. Use global index at ~/.config/chrometools-mcp/index.json to discover available projects and scenarios.",
|
|
739
|
+
inputSchema: {
|
|
740
|
+
type: "object",
|
|
741
|
+
properties: {
|
|
742
|
+
scenarioName: {
|
|
743
|
+
type: "string",
|
|
744
|
+
description: "Name of scenario to export"
|
|
745
|
+
},
|
|
746
|
+
language: {
|
|
747
|
+
type: "string",
|
|
748
|
+
enum: ["playwright-typescript", "playwright-python", "selenium-python", "selenium-java"],
|
|
749
|
+
description: "Target test framework and language"
|
|
750
|
+
},
|
|
751
|
+
targetFile: {
|
|
752
|
+
type: "string",
|
|
753
|
+
description: "Path to existing test file to append to (REQUIRED)"
|
|
754
|
+
},
|
|
755
|
+
testName: {
|
|
756
|
+
type: "string",
|
|
757
|
+
description: "Override test name (default: from scenario name)"
|
|
758
|
+
},
|
|
759
|
+
insertPosition: {
|
|
760
|
+
type: "string",
|
|
761
|
+
enum: ["end", "before", "after"],
|
|
762
|
+
description: "Where to insert test: 'end' (default - after all tests), 'before' (before reference test), or 'after' (after reference test)"
|
|
763
|
+
},
|
|
764
|
+
referenceTestName: {
|
|
765
|
+
type: "string",
|
|
766
|
+
description: "Reference test name for 'before'/'after' insertion. Required when insertPosition is 'before' or 'after'"
|
|
767
|
+
},
|
|
768
|
+
cleanSelectors: {
|
|
769
|
+
type: "boolean",
|
|
770
|
+
description: "Remove unstable CSS classes (default: true)"
|
|
771
|
+
},
|
|
772
|
+
includeComments: {
|
|
773
|
+
type: "boolean",
|
|
774
|
+
description: "Include descriptive comments (default: true)"
|
|
775
|
+
},
|
|
776
|
+
generatePageObject: {
|
|
777
|
+
type: "boolean",
|
|
778
|
+
description: "Also generate Page Object class for the page (default: false)"
|
|
779
|
+
},
|
|
780
|
+
pageObjectClassName: {
|
|
781
|
+
type: "string",
|
|
782
|
+
description: "Page Object class name (optional, auto-generated if not provided)"
|
|
783
|
+
},
|
|
784
|
+
},
|
|
785
|
+
required: ["scenarioName", "language", "targetFile"],
|
|
786
|
+
},
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
name: "generatePageObject",
|
|
790
|
+
description: "Generate Page Object Model (POM) class from current page analysis. Analyzes page structure, extracts interactive elements (inputs, buttons, links), groups them by sections (header, nav, form, etc.), and generates framework-specific code. Supports Playwright (TypeScript/Python) and Selenium (Python/Java). Auto-generates smart element names and helper methods.",
|
|
791
|
+
inputSchema: {
|
|
792
|
+
type: "object",
|
|
793
|
+
properties: {
|
|
794
|
+
className: {
|
|
795
|
+
type: "string",
|
|
796
|
+
description: "Page Object class name (optional, auto-generated from page title/URL if not provided)"
|
|
797
|
+
},
|
|
798
|
+
framework: {
|
|
799
|
+
type: "string",
|
|
800
|
+
enum: ["playwright-typescript", "playwright-python", "selenium-python", "selenium-java"],
|
|
801
|
+
description: "Target test framework (default: playwright-typescript)"
|
|
802
|
+
},
|
|
803
|
+
includeComments: {
|
|
804
|
+
type: "boolean",
|
|
805
|
+
description: "Include descriptive comments in generated code (default: true)"
|
|
806
|
+
},
|
|
807
|
+
groupElements: {
|
|
808
|
+
type: "boolean",
|
|
809
|
+
description: "Group elements by page sections (default: true)"
|
|
810
|
+
},
|
|
811
|
+
},
|
|
812
|
+
},
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
name: "listTabs",
|
|
816
|
+
description: "List all open browser tabs with their URLs, titles, and active status. Use this to see all tabs opened manually or via window.open/target='_blank'. Returns tab index for use with switchTab.",
|
|
817
|
+
inputSchema: {
|
|
818
|
+
type: "object",
|
|
819
|
+
properties: {},
|
|
820
|
+
},
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
name: "switchTab",
|
|
824
|
+
description: "Switch active browser tab by index or URL pattern. After switch, all subsequent commands will target the new active tab. Use listTabs first to see available tabs.",
|
|
825
|
+
inputSchema: {
|
|
826
|
+
type: "object",
|
|
827
|
+
properties: {
|
|
828
|
+
tab: {
|
|
829
|
+
oneOf: [
|
|
830
|
+
{ type: "number", minimum: 0, description: "Tab index (0-based)" },
|
|
831
|
+
{ type: "string", description: "URL pattern to match (partial match)" }
|
|
832
|
+
],
|
|
833
|
+
description: "Tab identifier: index number or URL pattern to match"
|
|
834
|
+
},
|
|
835
|
+
},
|
|
836
|
+
required: ["tab"],
|
|
837
|
+
},
|
|
838
|
+
},
|
|
839
|
+
];
|