@probebrowser/mcp-server 1.2.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.
package/dist/tools.js ADDED
@@ -0,0 +1,761 @@
1
+ import { z } from 'zod';
2
+ export const TOOLS = {
3
+ // ============================================
4
+ // CONSOLE & ERRORS (6)
5
+ // ============================================
6
+ trace_get_console_summary: {
7
+ method: 'get_console_summary',
8
+ description: 'Get a summary of console logs by type (info, warn, error) and confidence.',
9
+ schema: z.object({}),
10
+ },
11
+ trace_get_console_errors: {
12
+ method: 'get_console_errors',
13
+ description: 'Get all console errors from the current page. Useful for debugging crashes and JS exceptions.',
14
+ schema: z.object({}),
15
+ },
16
+ trace_get_error_groups: {
17
+ method: 'get_error_groups',
18
+ description: 'Get errors grouped by message/stack to reduce noise.',
19
+ schema: z.object({}),
20
+ },
21
+ trace_get_grouped_exceptions: {
22
+ method: 'get_grouped_exceptions',
23
+ description: 'Get grouped exceptions with occurrence counts.',
24
+ schema: z.object({}),
25
+ },
26
+ trace_suggest_fix: {
27
+ method: 'suggest_fix',
28
+ description: 'Get AI-powered code fix suggestions for specific errors.',
29
+ schema: z.object({}),
30
+ },
31
+ trace_explain_call_stack: {
32
+ method: 'explain_call_stack',
33
+ description: 'Get AI explanation of the stack trace logic.',
34
+ schema: z.object({}),
35
+ },
36
+ // ============================================
37
+ // NETWORK TOOLS (10)
38
+ // ============================================
39
+ trace_get_network_summary: {
40
+ method: 'get_network_summary',
41
+ description: 'Get a summary of network activity (total requests, failed, size, finish time).',
42
+ schema: z.object({}),
43
+ },
44
+ trace_get_network_failed: {
45
+ method: 'get_network_failed',
46
+ description: 'Get a list of all failed network requests (4xx, 5xx, or connection errors).',
47
+ schema: z.object({}),
48
+ },
49
+ trace_get_request_headers: {
50
+ method: 'get_request_headers',
51
+ description: 'Inspect raw headers for a specific request ID.',
52
+ schema: z.object({
53
+ requestId: z.string().describe('The ID of the request'),
54
+ }),
55
+ },
56
+ trace_get_response_body: {
57
+ method: 'get_response_body',
58
+ description: 'Read the body content of a response.',
59
+ schema: z.object({
60
+ requestId: z.string().describe('The ID of the request'),
61
+ }),
62
+ },
63
+ trace_get_cached_requests: {
64
+ method: 'get_cached_requests',
65
+ description: 'List requests served from browser cache.',
66
+ schema: z.object({}),
67
+ },
68
+ trace_get_timing_breakdown: {
69
+ method: 'get_timing_breakdown',
70
+ description: 'Detailed timing (DNS, SSL, TTFB, Content Download).',
71
+ schema: z.object({
72
+ requestId: z.string().describe('The ID of the request'),
73
+ }),
74
+ },
75
+ trace_filter_requests_by_type: {
76
+ method: 'filter_requests_by_type',
77
+ description: 'Filter by XHR, Fetch, Image, CSS, JS.',
78
+ schema: z.object({
79
+ type: z.string().describe('The resource type (XHR, Script, Image, etc.)'),
80
+ }),
81
+ },
82
+ trace_search_in_responses: {
83
+ method: 'search_in_responses',
84
+ description: 'Text search across all response bodies.',
85
+ schema: z.object({
86
+ pattern: z.string().describe('The text or regex to search for'),
87
+ }),
88
+ },
89
+ trace_get_redirect_chain: {
90
+ method: 'get_redirect_chain',
91
+ description: 'Trace HTTP redirect paths.',
92
+ schema: z.object({
93
+ requestId: z.string().describe('The ID of the request'),
94
+ }),
95
+ },
96
+ trace_replay_request: {
97
+ method: 'replay_request',
98
+ description: 'Replay a specific network request by ID to test if it fails again.',
99
+ schema: z.object({
100
+ requestId: z.string().describe('The ID of the request to replay'),
101
+ }),
102
+ },
103
+ // ============================================
104
+ // DOM & UI TOOLS (16)
105
+ // ============================================
106
+ trace_inspect_element: {
107
+ method: 'inspect_element',
108
+ description: 'Inspect a DOM element by selector (visibility, size, attributes).',
109
+ schema: z.object({
110
+ selector: z.string().describe('CSS selector of the element to inspect'),
111
+ }),
112
+ },
113
+ trace_find_elements: {
114
+ method: 'find_elements',
115
+ description: 'Search DOM by CSS selector.',
116
+ schema: z.object({
117
+ selector: z.string().describe('CSS selector'),
118
+ }),
119
+ },
120
+ trace_get_element_styles: {
121
+ method: 'get_element_styles',
122
+ description: 'Get full computed style object.',
123
+ schema: z.object({
124
+ selector: z.string().describe('CSS selector'),
125
+ }),
126
+ },
127
+ trace_get_dom_tree: {
128
+ method: 'get_dom_tree',
129
+ description: 'Get a simplified tree structure of the page.',
130
+ schema: z.object({
131
+ depth: z.number().optional().describe('Depth of tree to retrieve (default 3)'),
132
+ }),
133
+ },
134
+ trace_get_element_events: {
135
+ method: 'get_element_events',
136
+ description: 'List event listeners attached to a node.',
137
+ schema: z.object({
138
+ selector: z.string().describe('CSS selector'),
139
+ }),
140
+ },
141
+ trace_edit_element_style: {
142
+ method: 'edit_element_style',
143
+ description: 'Apply CSS changes to an element live.',
144
+ schema: z.object({
145
+ selector: z.string().describe('CSS selector'),
146
+ property: z.string().describe('CSS property name'),
147
+ value: z.string().describe('CSS property value'),
148
+ }),
149
+ },
150
+ trace_watch_dom_changes: {
151
+ method: 'watch_dom_changes',
152
+ description: 'Monitor mutations (sub-tree modifications).',
153
+ schema: z.object({
154
+ selector: z.string().describe('CSS selector'),
155
+ }),
156
+ },
157
+ trace_diagnose_layout: {
158
+ method: 'diagnose_layout',
159
+ description: 'AI analysis of layout shifts or breaking elements.',
160
+ schema: z.object({
161
+ selector: z.string().describe('CSS selector'),
162
+ }),
163
+ },
164
+ trace_analyze_visibility: {
165
+ method: 'analyze_visibility',
166
+ description: 'Deep visibility audit (opacity, display, overlap).',
167
+ schema: z.object({
168
+ selector: z.string().describe('CSS selector'),
169
+ }),
170
+ },
171
+ trace_why_hidden: {
172
+ method: 'why_hidden',
173
+ description: 'Alias for analyze_visibility.',
174
+ schema: z.object({
175
+ selector: z.string().describe('CSS selector'),
176
+ }),
177
+ },
178
+ trace_style_summary: {
179
+ method: 'style_summary',
180
+ description: 'Aggregate style report.',
181
+ schema: z.object({
182
+ selector: z.string().describe('CSS selector'),
183
+ }),
184
+ },
185
+ trace_css_influence: {
186
+ method: 'css_influence',
187
+ description: 'See which selectors match and which win.',
188
+ schema: z.object({
189
+ selector: z.string().describe('CSS selector'),
190
+ }),
191
+ },
192
+ trace_check_accessibility: {
193
+ method: 'check_accessibility',
194
+ description: 'Check the page for accessibility issues (missing alt text, low contrast).',
195
+ schema: z.object({
196
+ selector: z.string().optional().describe('Optional selector to limit check'),
197
+ }),
198
+ },
199
+ trace_highlight_element: {
200
+ method: 'highlight_element',
201
+ description: 'Visually highlight an element on the screen.',
202
+ schema: z.object({
203
+ selector: z.string().describe('CSS selector'),
204
+ }),
205
+ },
206
+ trace_scroll_to_element: {
207
+ method: 'scroll_to_element',
208
+ description: 'Scroll viewport to element.',
209
+ schema: z.object({
210
+ selector: z.string().describe('CSS selector'),
211
+ }),
212
+ },
213
+ // ============================================
214
+ // DEBUGGER TOOLS (24)
215
+ // ============================================
216
+ trace_get_debugger_state: {
217
+ method: 'get_debugger_state',
218
+ description: 'Is the debugger paused? On what line?',
219
+ schema: z.object({}),
220
+ },
221
+ trace_get_call_stack: {
222
+ method: 'get_call_stack',
223
+ description: 'Current execution stack frames.',
224
+ schema: z.object({}),
225
+ },
226
+ trace_get_variables: {
227
+ method: 'get_variables',
228
+ description: 'Scope variables (Local, Closure, Global).',
229
+ schema: z.object({
230
+ frameIndex: z.number().optional().describe('Stack frame index (default 0)'),
231
+ }),
232
+ },
233
+ trace_step_debugger: {
234
+ method: 'step_debugger',
235
+ description: 'Step Over/Into/Out control.',
236
+ schema: z.object({
237
+ action: z.enum(['over', 'into', 'out', 'resume', 'pause']).describe('Action to perform'),
238
+ }),
239
+ },
240
+ trace_set_breakpoint: {
241
+ method: 'set_breakpoint',
242
+ description: 'Pause on specific file/line.',
243
+ schema: z.object({
244
+ url: z.string().describe('File URL'),
245
+ line: z.number().describe('Line number (0-indexed)'),
246
+ condition: z.string().optional().describe('Optional JS condition'),
247
+ }),
248
+ },
249
+ trace_remove_breakpoint: {
250
+ method: 'remove_breakpoint',
251
+ description: 'Clear breakpoint.',
252
+ schema: z.object({
253
+ breakpointId: z.string().describe('ID of breakpoint to remove'),
254
+ }),
255
+ },
256
+ trace_evaluate_expression: {
257
+ method: 'evaluate_expression',
258
+ description: 'Run Arbitrary JS in context.',
259
+ schema: z.object({
260
+ expression: z.string().describe('JS code to evaluate'),
261
+ }),
262
+ },
263
+ trace_set_exception_breakpoint: {
264
+ method: 'set_exception_breakpoint',
265
+ description: 'Pause on All or Uncaught exceptions.',
266
+ schema: z.object({
267
+ state: z.enum(['all', 'uncaught', 'none']).describe('Exception pause state'),
268
+ }),
269
+ },
270
+ trace_set_logpoint: {
271
+ method: 'set_logpoint',
272
+ description: 'console.log without changing code.',
273
+ schema: z.object({
274
+ url: z.string().describe('File URL'),
275
+ line: z.number().describe('Line number'),
276
+ expression: z.string().describe('Expression to log'),
277
+ }),
278
+ },
279
+ trace_get_logpoints: {
280
+ method: 'get_logpoints',
281
+ description: 'List active logpoints.',
282
+ schema: z.object({}),
283
+ },
284
+ trace_add_watch: {
285
+ method: 'add_watch',
286
+ description: 'Monitor expression value over time.',
287
+ schema: z.object({
288
+ expression: z.string().describe('Expression to watch'),
289
+ }),
290
+ },
291
+ trace_remove_watch: {
292
+ method: 'remove_watch',
293
+ description: 'Stop monitoring.',
294
+ schema: z.object({
295
+ expression: z.string().describe('Expression to remove'),
296
+ }),
297
+ },
298
+ trace_get_watches: {
299
+ method: 'get_watches',
300
+ description: 'Get current values of watched expressions.',
301
+ schema: z.object({}),
302
+ },
303
+ trace_watch_for_changes: {
304
+ method: 'watch_for_changes',
305
+ description: 'Pause when a variable value changes.',
306
+ schema: z.object({
307
+ expression: z.string().describe('Expression to watch'),
308
+ }),
309
+ },
310
+ trace_check_changes: {
311
+ method: 'check_changes',
312
+ description: 'Verify if watched variables changed.',
313
+ schema: z.object({}),
314
+ },
315
+ trace_trace_variable_origin: {
316
+ method: 'trace_variable_origin',
317
+ description: 'Attempt to find where a variable was defined.',
318
+ schema: z.object({
319
+ variable: z.string().describe('Variable name'),
320
+ }),
321
+ },
322
+ trace_capture_execution_state: {
323
+ method: 'capture_execution_state',
324
+ description: 'Snapshot of current state.',
325
+ schema: z.object({}),
326
+ },
327
+ trace_get_execution_history: {
328
+ method: 'get_execution_history',
329
+ description: 'Reverse debugging/step-back data (if enabled).',
330
+ schema: z.object({}),
331
+ },
332
+ trace_pause_execution: {
333
+ method: 'pause_execution',
334
+ description: 'Force pause.',
335
+ schema: z.object({}),
336
+ },
337
+ trace_resume_execution: {
338
+ method: 'resume_execution',
339
+ description: 'Continue execution.',
340
+ schema: z.object({}),
341
+ },
342
+ trace_set_dom_breakpoint: {
343
+ method: 'set_dom_breakpoint_by_selector',
344
+ description: 'Break on node modification.',
345
+ schema: z.object({
346
+ selector: z.string().describe('CSS selector'),
347
+ type: z.enum(['subtree-modified', 'attribute-modified', 'node-removed']).describe('Breakpoint type'),
348
+ }),
349
+ },
350
+ trace_set_event_breakpoint: {
351
+ method: 'set_event_breakpoint',
352
+ description: 'Break on events (click, submit, etc).',
353
+ schema: z.object({
354
+ eventName: z.string().describe('Event name'),
355
+ }),
356
+ },
357
+ trace_inspect_mode: {
358
+ method: 'inspect_mode',
359
+ description: 'Enable element selection mode.',
360
+ schema: z.object({
361
+ enable: z.boolean().describe('True to enable, false to disable'),
362
+ }),
363
+ },
364
+ // ============================================
365
+ // SOURCE TOOLS (8)
366
+ // ============================================
367
+ trace_list_scripts: {
368
+ method: 'list_scripts',
369
+ description: 'List loaded scripts.',
370
+ schema: z.object({}),
371
+ },
372
+ trace_get_source_snippet: {
373
+ method: 'get_source_snippet',
374
+ description: 'Get source code around a line.',
375
+ schema: z.object({
376
+ scriptId: z.string().describe('Script ID'),
377
+ line: z.number().describe('Line number'),
378
+ }),
379
+ },
380
+ trace_format_source: {
381
+ method: 'format_source',
382
+ description: 'Prettify minified source code.',
383
+ schema: z.object({
384
+ scriptId: z.string().describe('Script ID'),
385
+ }),
386
+ },
387
+ trace_search_in_sources: {
388
+ method: 'search_in_sources',
389
+ description: 'Search across loaded scripts.',
390
+ schema: z.object({
391
+ query: z.string().describe('Search query'),
392
+ }),
393
+ },
394
+ trace_blackbox_script: {
395
+ method: 'blackbox_script',
396
+ description: 'Ignore script in debugger stepping.',
397
+ schema: z.object({
398
+ pattern: z.string().describe('Regex pattern for script URL'),
399
+ }),
400
+ },
401
+ trace_get_original_location: {
402
+ method: 'get_original_location',
403
+ description: 'Map compiled location to source map location.',
404
+ schema: z.object({
405
+ scriptId: z.string().describe('Script ID'),
406
+ line: z.number().describe('Line number'),
407
+ column: z.number().default(0).describe('Column number'),
408
+ }),
409
+ },
410
+ trace_list_original_sources: {
411
+ method: 'list_original_sources',
412
+ description: 'List original source files from source maps.',
413
+ schema: z.object({
414
+ scriptId: z.string().describe('Script ID'),
415
+ }),
416
+ },
417
+ // ============================================
418
+ // PERFORMANCE TOOLS (4)
419
+ // ============================================
420
+ trace_get_performance_metrics: {
421
+ method: 'get_performance_metrics',
422
+ description: 'LCP, CLS, FID, Web Vitals.',
423
+ schema: z.object({}),
424
+ },
425
+ trace_take_heap_snapshot: {
426
+ method: 'take_heap_snapshot',
427
+ description: 'Take memory heap snapshot.',
428
+ schema: z.object({}),
429
+ },
430
+ trace_get_heap_snapshots: {
431
+ method: 'get_heap_snapshots',
432
+ description: 'List taken snapshots.',
433
+ schema: z.object({}),
434
+ },
435
+ trace_compare_heap_snapshots: {
436
+ method: 'compare_heap_snapshots',
437
+ description: 'Find memory leaks by comparing dumps.',
438
+ schema: z.object({
439
+ snapshot1: z.string().describe('ID of first snapshot'),
440
+ snapshot2: z.string().describe('ID of second snapshot'),
441
+ }),
442
+ },
443
+ // ============================================
444
+ // TIMELINE TOOLS (8)
445
+ // ============================================
446
+ trace_get_timeline: {
447
+ method: 'get_timeline',
448
+ description: 'Get Chrome tracing timeline events.',
449
+ schema: z.object({}),
450
+ },
451
+ trace_get_console_errors_after_network_failures: {
452
+ method: 'get_console_errors_after_network_failures',
453
+ description: 'Correlate events.',
454
+ schema: z.object({}),
455
+ },
456
+ trace_get_events_since_navigation: {
457
+ method: 'get_events_since_navigation',
458
+ description: 'Event log since last page load.',
459
+ schema: z.object({}),
460
+ },
461
+ trace_diff_from_snapshot: {
462
+ method: 'diff_from_snapshot',
463
+ description: 'Compare time ranges.',
464
+ schema: z.object({}),
465
+ },
466
+ trace_get_events_in_window: {
467
+ method: 'get_events_in_window',
468
+ description: 'Filter events by time window.',
469
+ schema: z.object({
470
+ window_ms: z.number().describe('Window size in ms'),
471
+ }),
472
+ },
473
+ trace_start_trace: {
474
+ method: 'start_trace',
475
+ description: 'Start recording a performance profile.',
476
+ schema: z.object({
477
+ name: z.string().describe('Name of the trace'),
478
+ }),
479
+ },
480
+ trace_get_trace_spans: {
481
+ method: 'get_trace_spans',
482
+ description: 'Get OpenTelemetry-style spans.',
483
+ schema: z.object({}),
484
+ },
485
+ trace_get_error_rate: {
486
+ method: 'get_error_rate',
487
+ description: 'Statistics on error frequency.',
488
+ schema: z.object({}),
489
+ },
490
+ // ============================================
491
+ // APPLICATION & STORAGE (14)
492
+ // ============================================
493
+ trace_get_cookies: {
494
+ method: 'get_cookies',
495
+ description: 'List cookies with security flags.',
496
+ schema: z.object({
497
+ urls: z.array(z.string()).optional().describe('Filter by URLs'),
498
+ }),
499
+ },
500
+ trace_set_cookie: {
501
+ method: 'set_cookie',
502
+ description: 'Set a cookie.',
503
+ schema: z.object({
504
+ name: z.string(),
505
+ value: z.string(),
506
+ domain: z.string(),
507
+ options: z.any().optional(),
508
+ }),
509
+ },
510
+ trace_delete_cookies: {
511
+ method: 'delete_cookies',
512
+ description: 'Delete cookies.',
513
+ schema: z.object({
514
+ name: z.string(),
515
+ domain: z.string().optional(),
516
+ }),
517
+ },
518
+ trace_clear_all_cookies: {
519
+ method: 'clear_all_cookies',
520
+ description: 'Clear all cookies.',
521
+ schema: z.object({}),
522
+ },
523
+ trace_get_local_storage: {
524
+ method: 'get_local_storage',
525
+ description: 'Read Local Storage.',
526
+ schema: z.object({}),
527
+ },
528
+ trace_get_session_storage: {
529
+ method: 'get_session_storage',
530
+ description: 'Read Session Storage.',
531
+ schema: z.object({}),
532
+ },
533
+ trace_set_storage_item: {
534
+ method: 'set_storage_item',
535
+ description: 'Set storage item.',
536
+ schema: z.object({
537
+ key: z.string(),
538
+ value: z.string(),
539
+ session: z.boolean().describe('True for session storage, false for local'),
540
+ }),
541
+ },
542
+ trace_clear_storage: {
543
+ method: 'clear_storage',
544
+ description: 'Wipe (local or session) storage.',
545
+ schema: z.object({
546
+ session: z.boolean().describe('True for session storage, false for local'),
547
+ }),
548
+ },
549
+ trace_get_service_workers: {
550
+ method: 'get_service_workers',
551
+ description: 'List active Service Workers.',
552
+ schema: z.object({}),
553
+ },
554
+ trace_unregister_service_worker: {
555
+ method: 'unregister_service_worker',
556
+ description: 'Unregister a Service Worker.',
557
+ schema: z.object({
558
+ scope: z.string(),
559
+ }),
560
+ },
561
+ trace_get_indexeddb_databases: {
562
+ method: 'get_indexeddb_databases',
563
+ description: 'List IndexedDB databases.',
564
+ schema: z.object({}),
565
+ },
566
+ trace_get_indexeddb_data: {
567
+ method: 'get_indexeddb_data',
568
+ description: 'Read IndexedDB object store.',
569
+ schema: z.object({
570
+ database: z.string(),
571
+ objectStore: z.string(),
572
+ }),
573
+ },
574
+ trace_get_caches: {
575
+ method: 'get_caches',
576
+ description: 'Inspect Cache Storage API.',
577
+ schema: z.object({}),
578
+ },
579
+ trace_get_cache_contents: {
580
+ method: 'get_cache_contents',
581
+ description: 'Read Cache Storage contents.',
582
+ schema: z.object({
583
+ cacheName: z.string(),
584
+ }),
585
+ },
586
+ // ============================================
587
+ // SECURITY TOOLS (3)
588
+ // ============================================
589
+ trace_get_security_info: {
590
+ method: 'get_security_info',
591
+ description: 'Get security state (HTTPS, Certificate, Mixed Content).',
592
+ schema: z.object({}),
593
+ },
594
+ trace_check_mixed_content: {
595
+ method: 'check_mixed_content',
596
+ description: 'Check for mixed content issues.',
597
+ schema: z.object({}),
598
+ },
599
+ trace_get_certificate_info: {
600
+ method: 'get_certificate_info',
601
+ description: 'Get detailed SSL/TLS certificate info.',
602
+ schema: z.object({}),
603
+ },
604
+ // ============================================
605
+ // PROFILER (3)
606
+ // ============================================
607
+ trace_start_cpu_profile: {
608
+ method: 'start_cpu_profile',
609
+ description: 'Start CPU profiling.',
610
+ schema: z.object({}),
611
+ },
612
+ trace_stop_cpu_profile: {
613
+ method: 'stop_cpu_profile',
614
+ description: 'Stop CPU profiling.',
615
+ schema: z.object({}),
616
+ },
617
+ trace_get_profile_snapshot: {
618
+ method: 'get_profile_snapshot',
619
+ description: 'Get simple profile snapshot (hot paths).',
620
+ schema: z.object({
621
+ duration_ms: z.number().optional().describe('Duration to profile in ms (default 5000)'),
622
+ }),
623
+ },
624
+ // ============================================
625
+ // INTERACTION TOOLS (ACTIVE) (5)
626
+ // ============================================
627
+ trace_click: {
628
+ method: 'click',
629
+ description: 'Click an element (smart wait & scroll).',
630
+ schema: z.object({
631
+ selector: z.string().describe('CSS selector'),
632
+ }),
633
+ },
634
+ trace_type: {
635
+ method: 'type',
636
+ description: 'Type text into input.',
637
+ schema: z.object({
638
+ selector: z.string().describe('CSS selector'),
639
+ text: z.string().describe('Text to type'),
640
+ }),
641
+ },
642
+ trace_hover: {
643
+ method: 'hover',
644
+ description: 'Hover over element.',
645
+ schema: z.object({
646
+ selector: z.string().describe('CSS selector'),
647
+ }),
648
+ },
649
+ trace_scroll: {
650
+ method: 'scroll',
651
+ description: 'Scroll page.',
652
+ schema: z.object({
653
+ direction: z.enum(['up', 'down', 'top', 'bottom']).optional().describe('Scroll direction (default bottom)'),
654
+ }),
655
+ },
656
+ trace_wait_for: {
657
+ method: 'wait_for',
658
+ description: 'Pause until element appears.',
659
+ schema: z.object({
660
+ selector: z.string().describe('CSS selector'),
661
+ }),
662
+ },
663
+ // ============================================
664
+ // CODE TOOLS (11)
665
+ // ============================================
666
+ trace_read_file: {
667
+ method: 'read_file',
668
+ description: 'Read local file content.',
669
+ schema: z.object({
670
+ path: z.string().describe('Absolute path'),
671
+ }),
672
+ },
673
+ trace_search_code: {
674
+ method: 'search_code',
675
+ description: 'Grep search in project.',
676
+ schema: z.object({
677
+ query: z.string().describe('Search term'),
678
+ }),
679
+ },
680
+ trace_get_file_tree: {
681
+ method: 'get_file_tree',
682
+ description: 'List project files.',
683
+ schema: z.object({
684
+ depth: z.number().optional().describe('Directory depth (default 3)'),
685
+ }),
686
+ },
687
+ trace_get_project_info: {
688
+ method: 'get_project_info',
689
+ description: 'Get package.json and tech stack summary.',
690
+ schema: z.object({}),
691
+ },
692
+ trace_get_error_context: {
693
+ method: 'get_error_context',
694
+ description: 'Automatically get code around a stack trace.',
695
+ schema: z.object({
696
+ error: z.string().describe('Error message or stack'),
697
+ }),
698
+ },
699
+ trace_git_blame: {
700
+ method: 'git_blame',
701
+ description: 'Get git authorship for lines.',
702
+ schema: z.object({
703
+ filePath: z.string().describe('File path'),
704
+ line: z.number().describe('Line number'),
705
+ }),
706
+ },
707
+ trace_git_recent_changes: {
708
+ method: 'git_recent_changes',
709
+ description: 'List recent commits affecting a file.',
710
+ schema: z.object({
711
+ filePath: z.string().describe('File path'),
712
+ days: z.number().optional().describe('Days lookback'),
713
+ }),
714
+ },
715
+ trace_get_imports: {
716
+ method: 'get_imports',
717
+ description: 'Static analysis of imports.',
718
+ schema: z.object({
719
+ filePath: z.string().describe('File path'),
720
+ }),
721
+ },
722
+ trace_find_usages: {
723
+ method: 'find_usages',
724
+ description: 'Find references to a symbol.',
725
+ schema: z.object({
726
+ query: z.string().describe('Symbol name'),
727
+ }),
728
+ },
729
+ trace_get_related_files: {
730
+ method: 'get_related_files',
731
+ description: 'Guess related files (e.g. Controller -> Model).',
732
+ schema: z.object({
733
+ filePath: z.string().describe('File path'),
734
+ }),
735
+ },
736
+ trace_get_env_vars: {
737
+ method: 'get_env_vars',
738
+ description: 'Safe subset of environment variables.',
739
+ schema: z.object({
740
+ filePath: z.string().optional().describe('Env file path'),
741
+ }),
742
+ },
743
+ // ============================================
744
+ // CONNECTION & META (2)
745
+ // ============================================
746
+ trace_connect: {
747
+ method: 'connect',
748
+ description: 'Connect to a browser page to start debugging. MUST be called first.',
749
+ schema: z.object({
750
+ url: z.string().describe('The URL to debug'),
751
+ headless: z.boolean().optional().describe('Run headless (default true)'),
752
+ }),
753
+ },
754
+ trace_p: {
755
+ method: 'deep_debug',
756
+ description: 'Run an interactive AI debugging session on the page.',
757
+ schema: z.object({
758
+ prompt: z.string().describe('The debugging question/goal'),
759
+ }),
760
+ },
761
+ };