@berthojoris/mcp-mysql-server 1.40.5 → 1.40.7
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 +23 -0
- package/DOCUMENTATIONS.md +55 -15
- package/README.md +37 -3
- package/dist/config/featureConfig.js +7 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.js +11 -4
- package/dist/mcp-server.js +129 -3
- package/dist/security/securityLayer.d.ts +1 -1
- package/dist/security/securityLayer.js +2 -2
- package/dist/tools/dataExportTools.d.ts +11 -0
- package/dist/tools/dataExportTools.js +68 -27
- package/dist/tools/ddlTools.d.ts +2 -0
- package/dist/tools/ddlTools.js +125 -20
- package/dist/tools/toolArgumentValidation.js +5 -0
- package/dist/tools/utilityTools.d.ts +16 -1
- package/dist/tools/utilityTools.js +73 -18
- package/manifest.json +2538 -732
- package/package.json +1 -1
package/manifest.json
CHANGED
|
@@ -1,733 +1,2539 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "mysql-mcp",
|
|
3
|
-
"description": "A Model Context Protocol for MySQL database interaction",
|
|
4
|
-
"version": "1.40.
|
|
5
|
-
"tools": [
|
|
6
|
-
{
|
|
7
|
-
"name": "list_databases",
|
|
8
|
-
"description": "Lists all databases available on the MySQL server.",
|
|
9
|
-
"input_schema": {
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"name": "list_tables",
|
|
19
|
-
"description": "Lists all tables in the connected
|
|
20
|
-
"input_schema": {
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
"type": "object",
|
|
106
|
-
"properties": {
|
|
107
|
-
"
|
|
108
|
-
"type": "
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
"
|
|
126
|
-
"type": "object"
|
|
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
|
-
"type": "
|
|
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
|
-
"type": "
|
|
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
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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
|
-
|
|
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
|
-
"type": "string"
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
"
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
"
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
"
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "mysql-mcp",
|
|
3
|
+
"description": "A Model Context Protocol for MySQL database interaction",
|
|
4
|
+
"version": "1.40.7",
|
|
5
|
+
"tools": [
|
|
6
|
+
{
|
|
7
|
+
"name": "list_databases",
|
|
8
|
+
"description": "Lists all databases available on the MySQL server. Use this to discover what databases exist before querying them.",
|
|
9
|
+
"input_schema": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"properties": {}
|
|
12
|
+
},
|
|
13
|
+
"output_schema": {
|
|
14
|
+
"type": "object"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "list_tables",
|
|
19
|
+
"description": "Lists all tables in the connected database. Use this as the first step when exploring an unfamiliar database to see available tables.",
|
|
20
|
+
"input_schema": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"properties": {
|
|
23
|
+
"database": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "Optional: specific database name to list tables from"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"output_schema": {
|
|
30
|
+
"type": "object"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "get_database_summary",
|
|
35
|
+
"description": "📊 Returns a high-level overview of the database including all tables, their columns, data types, row counts, and relationships. RECOMMENDED: Use this first when exploring a new database to understand its structure quickly. Features: database overview, per-table breakdown with primary keys, columns with nullable info and foreign key references, optional relationship summary, and configurable table limits.",
|
|
36
|
+
"input_schema": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"properties": {
|
|
39
|
+
"database": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Optional: specific database name"
|
|
42
|
+
},
|
|
43
|
+
"max_tables": {
|
|
44
|
+
"type": "number",
|
|
45
|
+
"description": "Optional: maximum number of tables to include (default: all tables, max 500)"
|
|
46
|
+
},
|
|
47
|
+
"include_relationships": {
|
|
48
|
+
"type": "boolean",
|
|
49
|
+
"description": "Optional: include foreign key relationships section (default: true)"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"output_schema": {
|
|
54
|
+
"type": "object"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "get_schema_erd",
|
|
59
|
+
"description": "📈 Generates a visual Mermaid.js ER diagram showing tables and their relationships. Perfect for visualizing database structure and foreign key connections. Use when users ask to 'visualize' or 'diagram' the database.",
|
|
60
|
+
"input_schema": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"properties": {
|
|
63
|
+
"database": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"description": "Optional: specific database name"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"output_schema": {
|
|
70
|
+
"type": "object"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "get_schema_rag_context",
|
|
75
|
+
"description": "🎯 AI-OPTIMIZED: Returns ultra-compact schema information (tables, columns, keys, relationships, row estimates) designed specifically for LLM context windows. Use this when you need schema awareness but want to minimize token usage. Configurable limits for tables/columns.",
|
|
76
|
+
"input_schema": {
|
|
77
|
+
"type": "object",
|
|
78
|
+
"properties": {
|
|
79
|
+
"database": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"description": "Optional: specific database name"
|
|
82
|
+
},
|
|
83
|
+
"max_tables": {
|
|
84
|
+
"type": "number",
|
|
85
|
+
"description": "Optional: maximum number of tables to include (default 50, max 200)"
|
|
86
|
+
},
|
|
87
|
+
"max_columns": {
|
|
88
|
+
"type": "number",
|
|
89
|
+
"description": "Optional: maximum number of columns per table (default 12, max 200)"
|
|
90
|
+
},
|
|
91
|
+
"include_relationships": {
|
|
92
|
+
"type": "boolean",
|
|
93
|
+
"description": "Whether to include FK relationships section (default: true)"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"output_schema": {
|
|
98
|
+
"type": "object"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "get_column_statistics",
|
|
103
|
+
"description": "Returns detailed statistics for a specific column: min/max values, average, distinct count, null percentage, and value distribution. Use to understand data quality and ranges in a column before writing queries.",
|
|
104
|
+
"input_schema": {
|
|
105
|
+
"type": "object",
|
|
106
|
+
"properties": {
|
|
107
|
+
"table_name": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"description": "Name of the table"
|
|
110
|
+
},
|
|
111
|
+
"column_name": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"description": "Name of the column"
|
|
114
|
+
},
|
|
115
|
+
"database": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"description": "Optional: specific database name"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"required": [
|
|
121
|
+
"table_name",
|
|
122
|
+
"column_name"
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"output_schema": {
|
|
126
|
+
"type": "object"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "read_table_schema",
|
|
131
|
+
"description": "Returns complete schema definition for a table: columns, data types, constraints, keys, indexes, and defaults. Use when you need detailed structural information about a specific table.",
|
|
132
|
+
"input_schema": {
|
|
133
|
+
"type": "object",
|
|
134
|
+
"properties": {
|
|
135
|
+
"table_name": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"description": "Name of the table to read schema from"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"required": [
|
|
141
|
+
"table_name"
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
"output_schema": {
|
|
145
|
+
"type": "object"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "create_record",
|
|
150
|
+
"description": "Inserts a single new record into a table. For inserting multiple records at once, use bulk_insert for better performance.",
|
|
151
|
+
"input_schema": {
|
|
152
|
+
"type": "object",
|
|
153
|
+
"properties": {
|
|
154
|
+
"table_name": {
|
|
155
|
+
"type": "string",
|
|
156
|
+
"description": "Name of the table to insert into"
|
|
157
|
+
},
|
|
158
|
+
"data": {
|
|
159
|
+
"type": "object",
|
|
160
|
+
"description": "Object containing column names and values to insert"
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"required": [
|
|
164
|
+
"table_name",
|
|
165
|
+
"data"
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
"output_schema": {
|
|
169
|
+
"type": "object"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"name": "read_records",
|
|
174
|
+
"description": "Reads records from a table with built-in filtering, pagination, and sorting. Use this for simple data retrieval. For complex queries with JOINs or aggregations, use run_select_query instead.",
|
|
175
|
+
"input_schema": {
|
|
176
|
+
"type": "object",
|
|
177
|
+
"properties": {
|
|
178
|
+
"table_name": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"description": "Name of the table to read from"
|
|
181
|
+
},
|
|
182
|
+
"filters": {
|
|
183
|
+
"type": "array",
|
|
184
|
+
"description": "Array of filter conditions",
|
|
185
|
+
"items": {
|
|
186
|
+
"type": "object",
|
|
187
|
+
"properties": {
|
|
188
|
+
"field": {
|
|
189
|
+
"type": "string"
|
|
190
|
+
},
|
|
191
|
+
"operator": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"enum": [
|
|
194
|
+
"eq",
|
|
195
|
+
"neq",
|
|
196
|
+
"gt",
|
|
197
|
+
"gte",
|
|
198
|
+
"lt",
|
|
199
|
+
"lte",
|
|
200
|
+
"like",
|
|
201
|
+
"in"
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
"value": {
|
|
205
|
+
"description": "Value to compare against (can be string, number, boolean, or array for \"in\" operator)"
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"required": [
|
|
209
|
+
"field",
|
|
210
|
+
"operator",
|
|
211
|
+
"value"
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"pagination": {
|
|
216
|
+
"type": "object",
|
|
217
|
+
"properties": {
|
|
218
|
+
"page": {
|
|
219
|
+
"type": "number",
|
|
220
|
+
"description": "Page number (starting from 1)"
|
|
221
|
+
},
|
|
222
|
+
"limit": {
|
|
223
|
+
"type": "number",
|
|
224
|
+
"description": "Number of records per page"
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"sorting": {
|
|
229
|
+
"type": "object",
|
|
230
|
+
"properties": {
|
|
231
|
+
"field": {
|
|
232
|
+
"type": "string",
|
|
233
|
+
"description": "Field name to sort by"
|
|
234
|
+
},
|
|
235
|
+
"direction": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"enum": [
|
|
238
|
+
"asc",
|
|
239
|
+
"desc"
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"required": [
|
|
246
|
+
"table_name"
|
|
247
|
+
]
|
|
248
|
+
},
|
|
249
|
+
"output_schema": {
|
|
250
|
+
"type": "object"
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"name": "update_record",
|
|
255
|
+
"description": "Updates records in a table based on specified conditions. For updating many records with different values, use bulk_update for better performance.",
|
|
256
|
+
"input_schema": {
|
|
257
|
+
"type": "object",
|
|
258
|
+
"properties": {
|
|
259
|
+
"table_name": {
|
|
260
|
+
"type": "string",
|
|
261
|
+
"description": "Name of the table to update"
|
|
262
|
+
},
|
|
263
|
+
"data": {
|
|
264
|
+
"type": "object",
|
|
265
|
+
"description": "Object containing column names and new values"
|
|
266
|
+
},
|
|
267
|
+
"conditions": {
|
|
268
|
+
"type": "array",
|
|
269
|
+
"description": "Array of conditions to identify which records to update",
|
|
270
|
+
"items": {
|
|
271
|
+
"type": "object",
|
|
272
|
+
"properties": {
|
|
273
|
+
"field": {
|
|
274
|
+
"type": "string"
|
|
275
|
+
},
|
|
276
|
+
"operator": {
|
|
277
|
+
"type": "string",
|
|
278
|
+
"enum": [
|
|
279
|
+
"eq",
|
|
280
|
+
"neq",
|
|
281
|
+
"gt",
|
|
282
|
+
"gte",
|
|
283
|
+
"lt",
|
|
284
|
+
"lte",
|
|
285
|
+
"like",
|
|
286
|
+
"in"
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
"value": {}
|
|
290
|
+
},
|
|
291
|
+
"required": [
|
|
292
|
+
"field",
|
|
293
|
+
"operator",
|
|
294
|
+
"value"
|
|
295
|
+
]
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
"required": [
|
|
300
|
+
"table_name",
|
|
301
|
+
"data",
|
|
302
|
+
"conditions"
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
"output_schema": {
|
|
306
|
+
"type": "object"
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"name": "delete_record",
|
|
311
|
+
"description": "Deletes records from a table based on specified conditions. Always requires conditions for safety (no WHERE-less deletes). For deleting multiple record sets, use bulk_delete.",
|
|
312
|
+
"input_schema": {
|
|
313
|
+
"type": "object",
|
|
314
|
+
"properties": {
|
|
315
|
+
"table_name": {
|
|
316
|
+
"type": "string",
|
|
317
|
+
"description": "Name of the table to delete from"
|
|
318
|
+
},
|
|
319
|
+
"conditions": {
|
|
320
|
+
"type": "array",
|
|
321
|
+
"description": "Array of conditions to identify which records to delete",
|
|
322
|
+
"items": {
|
|
323
|
+
"type": "object",
|
|
324
|
+
"properties": {
|
|
325
|
+
"field": {
|
|
326
|
+
"type": "string"
|
|
327
|
+
},
|
|
328
|
+
"operator": {
|
|
329
|
+
"type": "string",
|
|
330
|
+
"enum": [
|
|
331
|
+
"eq",
|
|
332
|
+
"neq",
|
|
333
|
+
"gt",
|
|
334
|
+
"gte",
|
|
335
|
+
"lt",
|
|
336
|
+
"lte",
|
|
337
|
+
"like",
|
|
338
|
+
"in"
|
|
339
|
+
]
|
|
340
|
+
},
|
|
341
|
+
"value": {}
|
|
342
|
+
},
|
|
343
|
+
"required": [
|
|
344
|
+
"field",
|
|
345
|
+
"operator",
|
|
346
|
+
"value"
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
"required": [
|
|
352
|
+
"table_name",
|
|
353
|
+
"conditions"
|
|
354
|
+
]
|
|
355
|
+
},
|
|
356
|
+
"output_schema": {
|
|
357
|
+
"type": "object"
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"name": "bulk_insert",
|
|
362
|
+
"description": "⚡ PERFORMANCE: Inserts multiple records efficiently using batch processing. Handles 1000s of rows with automatic batching. Use this instead of create_record when inserting many records at once (10+ rows).",
|
|
363
|
+
"input_schema": {
|
|
364
|
+
"type": "object",
|
|
365
|
+
"properties": {
|
|
366
|
+
"table_name": {
|
|
367
|
+
"type": "string",
|
|
368
|
+
"description": "Name of the table to insert into"
|
|
369
|
+
},
|
|
370
|
+
"data": {
|
|
371
|
+
"type": "array",
|
|
372
|
+
"description": "Array of objects containing column names and values to insert",
|
|
373
|
+
"minItems": 1,
|
|
374
|
+
"items": {
|
|
375
|
+
"type": "object",
|
|
376
|
+
"additionalProperties": true
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"batch_size": {
|
|
380
|
+
"type": "number",
|
|
381
|
+
"description": "Optional batch size for processing (default: 1000, max: 10000)",
|
|
382
|
+
"minimum": 1,
|
|
383
|
+
"maximum": 10000
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
"required": [
|
|
387
|
+
"table_name",
|
|
388
|
+
"data"
|
|
389
|
+
]
|
|
390
|
+
},
|
|
391
|
+
"output_schema": {
|
|
392
|
+
"type": "object"
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"name": "bulk_update",
|
|
397
|
+
"description": "⚡ PERFORMANCE: Updates multiple records with different values in batches. Each update can have unique conditions and data. Much faster than calling update_record repeatedly for multiple rows.",
|
|
398
|
+
"input_schema": {
|
|
399
|
+
"type": "object",
|
|
400
|
+
"properties": {
|
|
401
|
+
"table_name": {
|
|
402
|
+
"type": "string",
|
|
403
|
+
"description": "Name of the table to update"
|
|
404
|
+
},
|
|
405
|
+
"updates": {
|
|
406
|
+
"type": "array",
|
|
407
|
+
"description": "Array of update operations with data and conditions",
|
|
408
|
+
"minItems": 1,
|
|
409
|
+
"items": {
|
|
410
|
+
"type": "object",
|
|
411
|
+
"properties": {
|
|
412
|
+
"data": {
|
|
413
|
+
"type": "object",
|
|
414
|
+
"description": "Object containing column names and new values",
|
|
415
|
+
"additionalProperties": true
|
|
416
|
+
},
|
|
417
|
+
"conditions": {
|
|
418
|
+
"type": "array",
|
|
419
|
+
"description": "Array of conditions to identify which records to update",
|
|
420
|
+
"minItems": 1,
|
|
421
|
+
"items": {
|
|
422
|
+
"type": "object",
|
|
423
|
+
"properties": {
|
|
424
|
+
"field": {
|
|
425
|
+
"type": "string"
|
|
426
|
+
},
|
|
427
|
+
"operator": {
|
|
428
|
+
"type": "string",
|
|
429
|
+
"enum": [
|
|
430
|
+
"eq",
|
|
431
|
+
"neq",
|
|
432
|
+
"gt",
|
|
433
|
+
"gte",
|
|
434
|
+
"lt",
|
|
435
|
+
"lte",
|
|
436
|
+
"like",
|
|
437
|
+
"in"
|
|
438
|
+
]
|
|
439
|
+
},
|
|
440
|
+
"value": {}
|
|
441
|
+
},
|
|
442
|
+
"required": [
|
|
443
|
+
"field",
|
|
444
|
+
"operator",
|
|
445
|
+
"value"
|
|
446
|
+
]
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
"required": [
|
|
451
|
+
"data",
|
|
452
|
+
"conditions"
|
|
453
|
+
]
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
"batch_size": {
|
|
457
|
+
"type": "number",
|
|
458
|
+
"description": "Optional batch size for processing (default: 100, max: 1000)",
|
|
459
|
+
"minimum": 1,
|
|
460
|
+
"maximum": 1000
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
"required": [
|
|
464
|
+
"table_name",
|
|
465
|
+
"updates"
|
|
466
|
+
]
|
|
467
|
+
},
|
|
468
|
+
"output_schema": {
|
|
469
|
+
"type": "object"
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"name": "bulk_delete",
|
|
474
|
+
"description": "⚡ PERFORMANCE: Deletes multiple sets of records efficiently in batches. Each condition set defines a separate delete operation. More efficient than calling delete_record multiple times.",
|
|
475
|
+
"input_schema": {
|
|
476
|
+
"type": "object",
|
|
477
|
+
"properties": {
|
|
478
|
+
"table_name": {
|
|
479
|
+
"type": "string",
|
|
480
|
+
"description": "Name of the table to delete from"
|
|
481
|
+
},
|
|
482
|
+
"condition_sets": {
|
|
483
|
+
"type": "array",
|
|
484
|
+
"description": "Array of condition sets, each defining records to delete",
|
|
485
|
+
"minItems": 1,
|
|
486
|
+
"items": {
|
|
487
|
+
"type": "array",
|
|
488
|
+
"description": "Array of conditions for this delete operation",
|
|
489
|
+
"minItems": 1,
|
|
490
|
+
"items": {
|
|
491
|
+
"type": "object",
|
|
492
|
+
"properties": {
|
|
493
|
+
"field": {
|
|
494
|
+
"type": "string"
|
|
495
|
+
},
|
|
496
|
+
"operator": {
|
|
497
|
+
"type": "string",
|
|
498
|
+
"enum": [
|
|
499
|
+
"eq",
|
|
500
|
+
"neq",
|
|
501
|
+
"gt",
|
|
502
|
+
"gte",
|
|
503
|
+
"lt",
|
|
504
|
+
"lte",
|
|
505
|
+
"like",
|
|
506
|
+
"in"
|
|
507
|
+
]
|
|
508
|
+
},
|
|
509
|
+
"value": {}
|
|
510
|
+
},
|
|
511
|
+
"required": [
|
|
512
|
+
"field",
|
|
513
|
+
"operator",
|
|
514
|
+
"value"
|
|
515
|
+
]
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
"batch_size": {
|
|
520
|
+
"type": "number",
|
|
521
|
+
"description": "Optional batch size for processing (default: 100, max: 1000)",
|
|
522
|
+
"minimum": 1,
|
|
523
|
+
"maximum": 1000
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
"required": [
|
|
527
|
+
"table_name",
|
|
528
|
+
"condition_sets"
|
|
529
|
+
]
|
|
530
|
+
},
|
|
531
|
+
"output_schema": {
|
|
532
|
+
"type": "object"
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"name": "run_select_query",
|
|
537
|
+
"description": "⚡ PRIMARY TOOL FOR SELECT QUERIES. Executes read-only SELECT statements with parameterization, optimizer hints, query caching, and dry-run mode. Supports complex queries with JOINs, subqueries, and aggregations. ⚠️ ONLY for SELECT - use execute_write_query for INSERT/UPDATE/DELETE, use execute_ddl for CREATE/ALTER/DROP.",
|
|
538
|
+
"input_schema": {
|
|
539
|
+
"type": "object",
|
|
540
|
+
"properties": {
|
|
541
|
+
"query": {
|
|
542
|
+
"type": "string",
|
|
543
|
+
"description": "SQL SELECT query to execute"
|
|
544
|
+
},
|
|
545
|
+
"params": {
|
|
546
|
+
"type": "array",
|
|
547
|
+
"description": "Optional array of parameters for parameterized queries",
|
|
548
|
+
"items": {}
|
|
549
|
+
},
|
|
550
|
+
"hints": {
|
|
551
|
+
"type": "object",
|
|
552
|
+
"description": "Optional MySQL optimizer hints to apply to the query",
|
|
553
|
+
"properties": {
|
|
554
|
+
"maxExecutionTime": {
|
|
555
|
+
"type": "number",
|
|
556
|
+
"description": "Maximum execution time in milliseconds"
|
|
557
|
+
},
|
|
558
|
+
"forceIndex": {
|
|
559
|
+
"oneOf": [
|
|
560
|
+
{
|
|
561
|
+
"type": "string"
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
"type": "array",
|
|
565
|
+
"items": {
|
|
566
|
+
"type": "string"
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
],
|
|
570
|
+
"description": "Force usage of specific index(es)"
|
|
571
|
+
},
|
|
572
|
+
"ignoreIndex": {
|
|
573
|
+
"oneOf": [
|
|
574
|
+
{
|
|
575
|
+
"type": "string"
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"type": "array",
|
|
579
|
+
"items": {
|
|
580
|
+
"type": "string"
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
],
|
|
584
|
+
"description": "Ignore specific index(es)"
|
|
585
|
+
},
|
|
586
|
+
"straightJoin": {
|
|
587
|
+
"type": "boolean",
|
|
588
|
+
"description": "Use STRAIGHT_JOIN to force join order"
|
|
589
|
+
},
|
|
590
|
+
"noCache": {
|
|
591
|
+
"type": "boolean",
|
|
592
|
+
"description": "Disable query cache for this query"
|
|
593
|
+
},
|
|
594
|
+
"sqlBigResult": {
|
|
595
|
+
"type": "boolean",
|
|
596
|
+
"description": "Optimize for large result sets"
|
|
597
|
+
},
|
|
598
|
+
"sqlSmallResult": {
|
|
599
|
+
"type": "boolean",
|
|
600
|
+
"description": "Optimize for small result sets"
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
"useCache": {
|
|
605
|
+
"type": "boolean",
|
|
606
|
+
"description": "Whether to use query result caching (default: true)"
|
|
607
|
+
},
|
|
608
|
+
"dry_run": {
|
|
609
|
+
"type": "boolean",
|
|
610
|
+
"description": "If true, returns query plan and estimated cost without executing (Safe Mode)"
|
|
611
|
+
}
|
|
612
|
+
},
|
|
613
|
+
"required": [
|
|
614
|
+
"query"
|
|
615
|
+
]
|
|
616
|
+
},
|
|
617
|
+
"output_schema": {
|
|
618
|
+
"type": "object"
|
|
619
|
+
}
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
"name": "execute_write_query",
|
|
623
|
+
"description": "⚡ PRIMARY TOOL FOR INSERT/UPDATE/DELETE QUERIES. Executes data modification statements with parameterization support. Returns affected row count and execution details. ⚠️ NOT for SELECT (use run_select_query), NOT for DDL (use execute_ddl for CREATE/ALTER/DROP/TRUNCATE/RENAME).",
|
|
624
|
+
"input_schema": {
|
|
625
|
+
"type": "object",
|
|
626
|
+
"properties": {
|
|
627
|
+
"query": {
|
|
628
|
+
"type": "string",
|
|
629
|
+
"description": "SQL query to execute (INSERT, UPDATE, DELETE, or DDL if permitted)"
|
|
630
|
+
},
|
|
631
|
+
"params": {
|
|
632
|
+
"type": "array",
|
|
633
|
+
"description": "Optional array of parameters for parameterized queries",
|
|
634
|
+
"items": {}
|
|
635
|
+
}
|
|
636
|
+
},
|
|
637
|
+
"required": [
|
|
638
|
+
"query"
|
|
639
|
+
]
|
|
640
|
+
},
|
|
641
|
+
"output_schema": {
|
|
642
|
+
"type": "object"
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
"name": "repair_query",
|
|
647
|
+
"description": "🔧 Diagnoses SQL query errors and suggests fixes. Analyzes syntax errors, missing columns/tables, and logic issues. Provide the query and optional error message to get repair recommendations. Use when a query fails or needs debugging.",
|
|
648
|
+
"input_schema": {
|
|
649
|
+
"type": "object",
|
|
650
|
+
"properties": {
|
|
651
|
+
"query": {
|
|
652
|
+
"type": "string",
|
|
653
|
+
"description": "The SQL query to analyze or repair"
|
|
654
|
+
},
|
|
655
|
+
"error_message": {
|
|
656
|
+
"type": "string",
|
|
657
|
+
"description": "Optional error message received when executing the query"
|
|
658
|
+
}
|
|
659
|
+
},
|
|
660
|
+
"required": [
|
|
661
|
+
"query"
|
|
662
|
+
]
|
|
663
|
+
},
|
|
664
|
+
"output_schema": {
|
|
665
|
+
"type": "object"
|
|
666
|
+
}
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
"name": "create_table",
|
|
670
|
+
"description": "🏗️ Creates a new table with columns, data types, constraints, and indexes. Simplified interface compared to raw DDL. Requires \"ddl\" permission.",
|
|
671
|
+
"input_schema": {
|
|
672
|
+
"type": "object",
|
|
673
|
+
"properties": {
|
|
674
|
+
"table_name": {
|
|
675
|
+
"type": "string",
|
|
676
|
+
"description": "Name of the table to create"
|
|
677
|
+
},
|
|
678
|
+
"columns": {
|
|
679
|
+
"type": "array",
|
|
680
|
+
"description": "Array of column definitions",
|
|
681
|
+
"items": {
|
|
682
|
+
"type": "object",
|
|
683
|
+
"properties": {
|
|
684
|
+
"name": {
|
|
685
|
+
"type": "string",
|
|
686
|
+
"description": "Column name"
|
|
687
|
+
},
|
|
688
|
+
"type": {
|
|
689
|
+
"type": "string",
|
|
690
|
+
"description": "MySQL data type (e.g., VARCHAR(255), INT, TEXT)"
|
|
691
|
+
},
|
|
692
|
+
"nullable": {
|
|
693
|
+
"type": "boolean",
|
|
694
|
+
"description": "Whether column can be NULL"
|
|
695
|
+
},
|
|
696
|
+
"primary_key": {
|
|
697
|
+
"type": "boolean",
|
|
698
|
+
"description": "Whether this is the primary key"
|
|
699
|
+
},
|
|
700
|
+
"auto_increment": {
|
|
701
|
+
"type": "boolean",
|
|
702
|
+
"description": "Whether column auto-increments"
|
|
703
|
+
},
|
|
704
|
+
"default": {
|
|
705
|
+
"type": "string",
|
|
706
|
+
"description": "Default value"
|
|
707
|
+
}
|
|
708
|
+
},
|
|
709
|
+
"required": [
|
|
710
|
+
"name",
|
|
711
|
+
"type"
|
|
712
|
+
]
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
"indexes": {
|
|
716
|
+
"type": "array",
|
|
717
|
+
"description": "Optional indexes to create",
|
|
718
|
+
"items": {
|
|
719
|
+
"type": "object",
|
|
720
|
+
"properties": {
|
|
721
|
+
"name": {
|
|
722
|
+
"type": "string"
|
|
723
|
+
},
|
|
724
|
+
"columns": {
|
|
725
|
+
"type": "array",
|
|
726
|
+
"items": {
|
|
727
|
+
"type": "string"
|
|
728
|
+
}
|
|
729
|
+
},
|
|
730
|
+
"unique": {
|
|
731
|
+
"type": "boolean"
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
},
|
|
737
|
+
"required": [
|
|
738
|
+
"table_name",
|
|
739
|
+
"columns"
|
|
740
|
+
]
|
|
741
|
+
},
|
|
742
|
+
"output_schema": {
|
|
743
|
+
"type": "object"
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
"name": "alter_table",
|
|
748
|
+
"description": "🔧 Modifies existing table structure: add/drop/modify/rename columns, add/drop indexes. Supports multiple operations in one call. Requires \"ddl\" permission.",
|
|
749
|
+
"input_schema": {
|
|
750
|
+
"type": "object",
|
|
751
|
+
"properties": {
|
|
752
|
+
"table_name": {
|
|
753
|
+
"type": "string",
|
|
754
|
+
"description": "Name of the table to alter"
|
|
755
|
+
},
|
|
756
|
+
"operations": {
|
|
757
|
+
"type": "array",
|
|
758
|
+
"description": "Array of alter operations to perform",
|
|
759
|
+
"items": {
|
|
760
|
+
"type": "object",
|
|
761
|
+
"properties": {
|
|
762
|
+
"type": {
|
|
763
|
+
"type": "string",
|
|
764
|
+
"enum": [
|
|
765
|
+
"add_column",
|
|
766
|
+
"drop_column",
|
|
767
|
+
"modify_column",
|
|
768
|
+
"rename_column",
|
|
769
|
+
"add_index",
|
|
770
|
+
"drop_index"
|
|
771
|
+
],
|
|
772
|
+
"description": "Type of alteration"
|
|
773
|
+
},
|
|
774
|
+
"column_name": {
|
|
775
|
+
"type": "string"
|
|
776
|
+
},
|
|
777
|
+
"new_column_name": {
|
|
778
|
+
"type": "string"
|
|
779
|
+
},
|
|
780
|
+
"column_type": {
|
|
781
|
+
"type": "string"
|
|
782
|
+
},
|
|
783
|
+
"nullable": {
|
|
784
|
+
"type": "boolean"
|
|
785
|
+
},
|
|
786
|
+
"default": {
|
|
787
|
+
"type": "string"
|
|
788
|
+
},
|
|
789
|
+
"index_name": {
|
|
790
|
+
"type": "string"
|
|
791
|
+
},
|
|
792
|
+
"index_columns": {
|
|
793
|
+
"type": "array",
|
|
794
|
+
"items": {
|
|
795
|
+
"type": "string"
|
|
796
|
+
}
|
|
797
|
+
},
|
|
798
|
+
"unique": {
|
|
799
|
+
"type": "boolean"
|
|
800
|
+
}
|
|
801
|
+
},
|
|
802
|
+
"required": [
|
|
803
|
+
"type"
|
|
804
|
+
]
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
},
|
|
808
|
+
"required": [
|
|
809
|
+
"table_name",
|
|
810
|
+
"operations"
|
|
811
|
+
]
|
|
812
|
+
},
|
|
813
|
+
"output_schema": {
|
|
814
|
+
"type": "object"
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
"name": "drop_table",
|
|
819
|
+
"description": "🗑️ DESTRUCTIVE: Permanently deletes a table and ALL its data. Cannot be undone! Requires \"ddl\" permission. ⚠️ WARNING: IRREVERSIBLE!",
|
|
820
|
+
"input_schema": {
|
|
821
|
+
"type": "object",
|
|
822
|
+
"properties": {
|
|
823
|
+
"table_name": {
|
|
824
|
+
"type": "string",
|
|
825
|
+
"description": "Name of the table to drop"
|
|
826
|
+
},
|
|
827
|
+
"if_exists": {
|
|
828
|
+
"type": "boolean",
|
|
829
|
+
"description": "If true, will not error if table does not exist"
|
|
830
|
+
}
|
|
831
|
+
},
|
|
832
|
+
"required": [
|
|
833
|
+
"table_name"
|
|
834
|
+
]
|
|
835
|
+
},
|
|
836
|
+
"output_schema": {
|
|
837
|
+
"type": "object"
|
|
838
|
+
}
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
"name": "execute_ddl",
|
|
842
|
+
"description": "⚡ PRIMARY TOOL FOR DDL STATEMENTS. Executes schema modification queries: CREATE, ALTER, DROP, TRUNCATE, RENAME. Use for complex DDL that structured tools don't cover. ⚠️ NOT for SELECT (use run_select_query), NOT for INSERT/UPDATE/DELETE (use execute_write_query). Requires \"ddl\" permission.",
|
|
843
|
+
"input_schema": {
|
|
844
|
+
"type": "object",
|
|
845
|
+
"properties": {
|
|
846
|
+
"query": {
|
|
847
|
+
"type": "string",
|
|
848
|
+
"description": "DDL SQL query to execute (must start with CREATE, ALTER, DROP, TRUNCATE, or RENAME - NO SELECT queries!)"
|
|
849
|
+
}
|
|
850
|
+
},
|
|
851
|
+
"required": [
|
|
852
|
+
"query"
|
|
853
|
+
]
|
|
854
|
+
},
|
|
855
|
+
"output_schema": {
|
|
856
|
+
"type": "object"
|
|
857
|
+
}
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
"name": "describe_connection",
|
|
861
|
+
"description": "Returns current database connection details: host, database name, user, port, and connection status. Use to verify which database you're connected to.",
|
|
862
|
+
"input_schema": {
|
|
863
|
+
"type": "object",
|
|
864
|
+
"properties": {}
|
|
865
|
+
},
|
|
866
|
+
"output_schema": {
|
|
867
|
+
"type": "object"
|
|
868
|
+
}
|
|
869
|
+
},
|
|
870
|
+
{
|
|
871
|
+
"name": "cursor_execute_request",
|
|
872
|
+
"description": "Cursor compatibility bridge for clients that can call MCP tools but cannot send arguments. Reads .cursor/mysql-mcp-request.json (or MYSQL_MCP_CURSOR_REQUEST_FILE) and dispatches to the requested MySQL MCP tool. The request file supports {\"tool\":\"execute_ddl\",\"arguments\":{\"query\":\"DROP TABLE IF EXISTS t;\"}} or direct SQL with {\"query\":\"...\",\"mode\":\"auto\"}.",
|
|
873
|
+
"input_schema": {
|
|
874
|
+
"type": "object",
|
|
875
|
+
"properties": {}
|
|
876
|
+
},
|
|
877
|
+
"output_schema": {
|
|
878
|
+
"type": "object"
|
|
879
|
+
}
|
|
880
|
+
},
|
|
881
|
+
{
|
|
882
|
+
"name": "read_changelog",
|
|
883
|
+
"description": "Reads the MySQL MCP Server changelog to see version history, new features, bug fixes, and breaking changes. Useful for understanding tool capabilities and recent updates.",
|
|
884
|
+
"input_schema": {
|
|
885
|
+
"type": "object",
|
|
886
|
+
"properties": {
|
|
887
|
+
"version": {
|
|
888
|
+
"type": "string",
|
|
889
|
+
"description": "Optional: specific version to read (e.g., '1.0.0')"
|
|
890
|
+
},
|
|
891
|
+
"limit": {
|
|
892
|
+
"type": "number",
|
|
893
|
+
"description": "Optional: limit character count (default: 5000)"
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
},
|
|
897
|
+
"output_schema": {
|
|
898
|
+
"type": "object"
|
|
899
|
+
}
|
|
900
|
+
},
|
|
901
|
+
{
|
|
902
|
+
"name": "test_connection",
|
|
903
|
+
"description": "Tests database connectivity and measures latency. Returns connection status and response time. Use to troubleshoot connection issues or check database availability.",
|
|
904
|
+
"input_schema": {
|
|
905
|
+
"type": "object",
|
|
906
|
+
"properties": {}
|
|
907
|
+
},
|
|
908
|
+
"output_schema": {
|
|
909
|
+
"type": "object"
|
|
910
|
+
}
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
"name": "list_all_tools",
|
|
914
|
+
"description": "📋 Returns complete catalog of all available tools with names, descriptions, parameters, and current permissions. Use to discover tool capabilities or when users ask 'what can you do?'.",
|
|
915
|
+
"input_schema": {
|
|
916
|
+
"type": "object",
|
|
917
|
+
"properties": {}
|
|
918
|
+
},
|
|
919
|
+
"output_schema": {
|
|
920
|
+
"type": "object"
|
|
921
|
+
}
|
|
922
|
+
},
|
|
923
|
+
{
|
|
924
|
+
"name": "get_all_tables_relationships",
|
|
925
|
+
"description": "Gets ALL table foreign key relationships in the entire database in a single efficient query. Returns a comprehensive relationship map showing parent-child connections between all tables. Much faster than querying table-by-table.",
|
|
926
|
+
"input_schema": {
|
|
927
|
+
"type": "object",
|
|
928
|
+
"properties": {
|
|
929
|
+
"database": {
|
|
930
|
+
"type": "string",
|
|
931
|
+
"description": "Optional: specific database name"
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
},
|
|
935
|
+
"output_schema": {
|
|
936
|
+
"type": "object"
|
|
937
|
+
}
|
|
938
|
+
},
|
|
939
|
+
{
|
|
940
|
+
"name": "begin_transaction",
|
|
941
|
+
"description": "🔄 Starts a new database transaction and returns a transaction ID. Use with commit_transaction or rollback_transaction to group multiple operations atomically. Essential for data consistency when multiple changes must succeed or fail together.",
|
|
942
|
+
"input_schema": {
|
|
943
|
+
"type": "object",
|
|
944
|
+
"properties": {
|
|
945
|
+
"transactionId": {
|
|
946
|
+
"type": "string",
|
|
947
|
+
"description": "Optional custom transaction ID. If not provided, one will be generated."
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
},
|
|
951
|
+
"output_schema": {
|
|
952
|
+
"type": "object"
|
|
953
|
+
}
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
"name": "commit_transaction",
|
|
957
|
+
"description": "✅ Commits an active transaction, making all changes permanent. Use after successful completion of all operations within a transaction started by begin_transaction.",
|
|
958
|
+
"input_schema": {
|
|
959
|
+
"type": "object",
|
|
960
|
+
"properties": {
|
|
961
|
+
"transactionId": {
|
|
962
|
+
"type": "string",
|
|
963
|
+
"description": "The transaction ID to commit"
|
|
964
|
+
}
|
|
965
|
+
},
|
|
966
|
+
"required": [
|
|
967
|
+
"transactionId"
|
|
968
|
+
]
|
|
969
|
+
},
|
|
970
|
+
"output_schema": {
|
|
971
|
+
"type": "object"
|
|
972
|
+
}
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
"name": "rollback_transaction",
|
|
976
|
+
"description": "↩️ Rolls back an active transaction, undoing ALL changes made within it. Use when an error occurs during transaction or when changes need to be cancelled.",
|
|
977
|
+
"input_schema": {
|
|
978
|
+
"type": "object",
|
|
979
|
+
"properties": {
|
|
980
|
+
"transactionId": {
|
|
981
|
+
"type": "string",
|
|
982
|
+
"description": "The transaction ID to rollback"
|
|
983
|
+
}
|
|
984
|
+
},
|
|
985
|
+
"required": [
|
|
986
|
+
"transactionId"
|
|
987
|
+
]
|
|
988
|
+
},
|
|
989
|
+
"output_schema": {
|
|
990
|
+
"type": "object"
|
|
991
|
+
}
|
|
992
|
+
},
|
|
993
|
+
{
|
|
994
|
+
"name": "get_transaction_status",
|
|
995
|
+
"description": "Shows all active transactions with their IDs, start times, and operation counts. Use to monitor transaction state or debug transaction issues.",
|
|
996
|
+
"input_schema": {
|
|
997
|
+
"type": "object",
|
|
998
|
+
"properties": {}
|
|
999
|
+
},
|
|
1000
|
+
"output_schema": {
|
|
1001
|
+
"type": "object"
|
|
1002
|
+
}
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
"name": "execute_in_transaction",
|
|
1006
|
+
"description": "Executes a SQL query within an existing transaction context. The query becomes part of the transaction and will be committed or rolled back with it. Use after begin_transaction.",
|
|
1007
|
+
"input_schema": {
|
|
1008
|
+
"type": "object",
|
|
1009
|
+
"properties": {
|
|
1010
|
+
"transactionId": {
|
|
1011
|
+
"type": "string",
|
|
1012
|
+
"description": "The transaction ID to execute the query within"
|
|
1013
|
+
},
|
|
1014
|
+
"query": {
|
|
1015
|
+
"type": "string",
|
|
1016
|
+
"description": "SQL query to execute within the transaction"
|
|
1017
|
+
},
|
|
1018
|
+
"params": {
|
|
1019
|
+
"type": "array",
|
|
1020
|
+
"description": "Optional array of parameters for parameterized queries",
|
|
1021
|
+
"items": {}
|
|
1022
|
+
}
|
|
1023
|
+
},
|
|
1024
|
+
"required": [
|
|
1025
|
+
"transactionId",
|
|
1026
|
+
"query"
|
|
1027
|
+
]
|
|
1028
|
+
},
|
|
1029
|
+
"output_schema": {
|
|
1030
|
+
"type": "object"
|
|
1031
|
+
}
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
"name": "list_stored_procedures",
|
|
1035
|
+
"description": "Lists all stored procedures in the specified database.",
|
|
1036
|
+
"input_schema": {
|
|
1037
|
+
"type": "object",
|
|
1038
|
+
"properties": {
|
|
1039
|
+
"database": {
|
|
1040
|
+
"type": "string",
|
|
1041
|
+
"description": "Optional: specific database name to list procedures from"
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
},
|
|
1045
|
+
"output_schema": {
|
|
1046
|
+
"type": "object"
|
|
1047
|
+
}
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
"name": "get_stored_procedure_info",
|
|
1051
|
+
"description": "Gets detailed information about a specific stored procedure including parameters and metadata.",
|
|
1052
|
+
"input_schema": {
|
|
1053
|
+
"type": "object",
|
|
1054
|
+
"properties": {
|
|
1055
|
+
"procedure_name": {
|
|
1056
|
+
"type": "string",
|
|
1057
|
+
"description": "Name of the stored procedure to get information for"
|
|
1058
|
+
},
|
|
1059
|
+
"database": {
|
|
1060
|
+
"type": "string",
|
|
1061
|
+
"description": "Optional: specific database name"
|
|
1062
|
+
}
|
|
1063
|
+
},
|
|
1064
|
+
"required": [
|
|
1065
|
+
"procedure_name"
|
|
1066
|
+
]
|
|
1067
|
+
},
|
|
1068
|
+
"output_schema": {
|
|
1069
|
+
"type": "object"
|
|
1070
|
+
}
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
"name": "execute_stored_procedure",
|
|
1074
|
+
"description": "Executes a stored procedure with optional parameters.",
|
|
1075
|
+
"input_schema": {
|
|
1076
|
+
"type": "object",
|
|
1077
|
+
"properties": {
|
|
1078
|
+
"procedure_name": {
|
|
1079
|
+
"type": "string",
|
|
1080
|
+
"description": "Name of the stored procedure to execute"
|
|
1081
|
+
},
|
|
1082
|
+
"parameters": {
|
|
1083
|
+
"type": "array",
|
|
1084
|
+
"description": "Optional array of parameters to pass to the stored procedure",
|
|
1085
|
+
"items": {}
|
|
1086
|
+
},
|
|
1087
|
+
"database": {
|
|
1088
|
+
"type": "string",
|
|
1089
|
+
"description": "Optional: specific database name"
|
|
1090
|
+
}
|
|
1091
|
+
},
|
|
1092
|
+
"required": [
|
|
1093
|
+
"procedure_name"
|
|
1094
|
+
]
|
|
1095
|
+
},
|
|
1096
|
+
"output_schema": {
|
|
1097
|
+
"type": "object"
|
|
1098
|
+
}
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
"name": "create_stored_procedure",
|
|
1102
|
+
"description": "Creates a new stored procedure with the specified parameters and body.",
|
|
1103
|
+
"input_schema": {
|
|
1104
|
+
"type": "object",
|
|
1105
|
+
"properties": {
|
|
1106
|
+
"procedure_name": {
|
|
1107
|
+
"type": "string",
|
|
1108
|
+
"description": "Name of the stored procedure to create"
|
|
1109
|
+
},
|
|
1110
|
+
"parameters": {
|
|
1111
|
+
"type": "array",
|
|
1112
|
+
"description": "Optional array of parameter definitions",
|
|
1113
|
+
"items": {
|
|
1114
|
+
"type": "object",
|
|
1115
|
+
"properties": {
|
|
1116
|
+
"name": {
|
|
1117
|
+
"type": "string",
|
|
1118
|
+
"description": "Parameter name"
|
|
1119
|
+
},
|
|
1120
|
+
"mode": {
|
|
1121
|
+
"type": "string",
|
|
1122
|
+
"enum": [
|
|
1123
|
+
"IN",
|
|
1124
|
+
"OUT",
|
|
1125
|
+
"INOUT"
|
|
1126
|
+
],
|
|
1127
|
+
"description": "Parameter mode"
|
|
1128
|
+
},
|
|
1129
|
+
"data_type": {
|
|
1130
|
+
"type": "string",
|
|
1131
|
+
"description": "MySQL data type (e.g., VARCHAR(255), INT)"
|
|
1132
|
+
}
|
|
1133
|
+
},
|
|
1134
|
+
"required": [
|
|
1135
|
+
"name",
|
|
1136
|
+
"mode",
|
|
1137
|
+
"data_type"
|
|
1138
|
+
]
|
|
1139
|
+
}
|
|
1140
|
+
},
|
|
1141
|
+
"body": {
|
|
1142
|
+
"type": "string",
|
|
1143
|
+
"description": "SQL body of the stored procedure"
|
|
1144
|
+
},
|
|
1145
|
+
"comment": {
|
|
1146
|
+
"type": "string",
|
|
1147
|
+
"description": "Optional comment for the stored procedure"
|
|
1148
|
+
},
|
|
1149
|
+
"database": {
|
|
1150
|
+
"type": "string",
|
|
1151
|
+
"description": "Optional: specific database name"
|
|
1152
|
+
}
|
|
1153
|
+
},
|
|
1154
|
+
"required": [
|
|
1155
|
+
"procedure_name",
|
|
1156
|
+
"body"
|
|
1157
|
+
]
|
|
1158
|
+
},
|
|
1159
|
+
"output_schema": {
|
|
1160
|
+
"type": "object"
|
|
1161
|
+
}
|
|
1162
|
+
},
|
|
1163
|
+
{
|
|
1164
|
+
"name": "drop_stored_procedure",
|
|
1165
|
+
"description": "Drops (deletes) a stored procedure. WARNING: This is irreversible!",
|
|
1166
|
+
"input_schema": {
|
|
1167
|
+
"type": "object",
|
|
1168
|
+
"properties": {
|
|
1169
|
+
"procedure_name": {
|
|
1170
|
+
"type": "string",
|
|
1171
|
+
"description": "Name of the stored procedure to drop"
|
|
1172
|
+
},
|
|
1173
|
+
"if_exists": {
|
|
1174
|
+
"type": "boolean",
|
|
1175
|
+
"description": "If true, will not error if procedure does not exist"
|
|
1176
|
+
},
|
|
1177
|
+
"database": {
|
|
1178
|
+
"type": "string",
|
|
1179
|
+
"description": "Optional: specific database name"
|
|
1180
|
+
}
|
|
1181
|
+
},
|
|
1182
|
+
"required": [
|
|
1183
|
+
"procedure_name"
|
|
1184
|
+
]
|
|
1185
|
+
},
|
|
1186
|
+
"output_schema": {
|
|
1187
|
+
"type": "object"
|
|
1188
|
+
}
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
"name": "show_create_procedure",
|
|
1192
|
+
"description": "Shows the CREATE statement for a stored procedure.",
|
|
1193
|
+
"input_schema": {
|
|
1194
|
+
"type": "object",
|
|
1195
|
+
"properties": {
|
|
1196
|
+
"procedure_name": {
|
|
1197
|
+
"type": "string",
|
|
1198
|
+
"description": "Name of the stored procedure to show CREATE statement for"
|
|
1199
|
+
},
|
|
1200
|
+
"database": {
|
|
1201
|
+
"type": "string",
|
|
1202
|
+
"description": "Optional: specific database name"
|
|
1203
|
+
}
|
|
1204
|
+
},
|
|
1205
|
+
"required": [
|
|
1206
|
+
"procedure_name"
|
|
1207
|
+
]
|
|
1208
|
+
},
|
|
1209
|
+
"output_schema": {
|
|
1210
|
+
"type": "object"
|
|
1211
|
+
}
|
|
1212
|
+
},
|
|
1213
|
+
{
|
|
1214
|
+
"name": "export_table_to_csv",
|
|
1215
|
+
"description": "📄 Exports table data to CSV format with filtering, pagination, and sorting. For sensitive data, use safe_export_table instead which includes automatic data masking.",
|
|
1216
|
+
"input_schema": {
|
|
1217
|
+
"type": "object",
|
|
1218
|
+
"properties": {
|
|
1219
|
+
"table_name": {
|
|
1220
|
+
"type": "string",
|
|
1221
|
+
"description": "Name of the table to export"
|
|
1222
|
+
},
|
|
1223
|
+
"filters": {
|
|
1224
|
+
"type": "array",
|
|
1225
|
+
"description": "Array of filter conditions",
|
|
1226
|
+
"items": {
|
|
1227
|
+
"type": "object",
|
|
1228
|
+
"properties": {
|
|
1229
|
+
"field": {
|
|
1230
|
+
"type": "string"
|
|
1231
|
+
},
|
|
1232
|
+
"operator": {
|
|
1233
|
+
"type": "string",
|
|
1234
|
+
"enum": [
|
|
1235
|
+
"eq",
|
|
1236
|
+
"neq",
|
|
1237
|
+
"gt",
|
|
1238
|
+
"gte",
|
|
1239
|
+
"lt",
|
|
1240
|
+
"lte",
|
|
1241
|
+
"like",
|
|
1242
|
+
"in"
|
|
1243
|
+
]
|
|
1244
|
+
},
|
|
1245
|
+
"value": {
|
|
1246
|
+
"description": "Value to compare against (can be string, number, boolean, or array for \"in\" operator)"
|
|
1247
|
+
}
|
|
1248
|
+
},
|
|
1249
|
+
"required": [
|
|
1250
|
+
"field",
|
|
1251
|
+
"operator",
|
|
1252
|
+
"value"
|
|
1253
|
+
]
|
|
1254
|
+
}
|
|
1255
|
+
},
|
|
1256
|
+
"pagination": {
|
|
1257
|
+
"type": "object",
|
|
1258
|
+
"properties": {
|
|
1259
|
+
"page": {
|
|
1260
|
+
"type": "number",
|
|
1261
|
+
"description": "Page number (starting from 1)"
|
|
1262
|
+
},
|
|
1263
|
+
"limit": {
|
|
1264
|
+
"type": "number",
|
|
1265
|
+
"description": "Number of records per page"
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
},
|
|
1269
|
+
"sorting": {
|
|
1270
|
+
"type": "object",
|
|
1271
|
+
"properties": {
|
|
1272
|
+
"field": {
|
|
1273
|
+
"type": "string",
|
|
1274
|
+
"description": "Field name to sort by"
|
|
1275
|
+
},
|
|
1276
|
+
"direction": {
|
|
1277
|
+
"type": "string",
|
|
1278
|
+
"enum": [
|
|
1279
|
+
"asc",
|
|
1280
|
+
"desc"
|
|
1281
|
+
]
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
},
|
|
1285
|
+
"include_headers": {
|
|
1286
|
+
"type": "boolean",
|
|
1287
|
+
"description": "Whether to include column headers in the CSV output"
|
|
1288
|
+
}
|
|
1289
|
+
},
|
|
1290
|
+
"required": [
|
|
1291
|
+
"table_name"
|
|
1292
|
+
]
|
|
1293
|
+
},
|
|
1294
|
+
"output_schema": {
|
|
1295
|
+
"type": "object"
|
|
1296
|
+
}
|
|
1297
|
+
},
|
|
1298
|
+
{
|
|
1299
|
+
"name": "export_query_to_csv",
|
|
1300
|
+
"description": "📄 Executes a SELECT query and exports results to CSV format. Supports complex queries with JOINs and aggregations. For sensitive data, consider using safe_export_table or adding manual data masking.",
|
|
1301
|
+
"input_schema": {
|
|
1302
|
+
"type": "object",
|
|
1303
|
+
"properties": {
|
|
1304
|
+
"query": {
|
|
1305
|
+
"type": "string",
|
|
1306
|
+
"description": "SQL SELECT query to execute and export"
|
|
1307
|
+
},
|
|
1308
|
+
"params": {
|
|
1309
|
+
"type": "array",
|
|
1310
|
+
"description": "Optional array of parameters for parameterized queries",
|
|
1311
|
+
"items": {}
|
|
1312
|
+
},
|
|
1313
|
+
"include_headers": {
|
|
1314
|
+
"type": "boolean",
|
|
1315
|
+
"description": "Whether to include column headers in the CSV output"
|
|
1316
|
+
}
|
|
1317
|
+
},
|
|
1318
|
+
"required": [
|
|
1319
|
+
"query"
|
|
1320
|
+
]
|
|
1321
|
+
},
|
|
1322
|
+
"output_schema": {
|
|
1323
|
+
"type": "object"
|
|
1324
|
+
}
|
|
1325
|
+
},
|
|
1326
|
+
{
|
|
1327
|
+
"name": "analyze_query",
|
|
1328
|
+
"description": "🔍 Analyzes a SQL query using EXPLAIN and provides optimization suggestions: missing indexes, inefficient operations, cost estimates. Returns actionable recommendations. Use before running expensive queries.",
|
|
1329
|
+
"input_schema": {
|
|
1330
|
+
"type": "object",
|
|
1331
|
+
"properties": {
|
|
1332
|
+
"query": {
|
|
1333
|
+
"type": "string",
|
|
1334
|
+
"description": "SQL query to analyze"
|
|
1335
|
+
}
|
|
1336
|
+
},
|
|
1337
|
+
"required": [
|
|
1338
|
+
"query"
|
|
1339
|
+
]
|
|
1340
|
+
},
|
|
1341
|
+
"output_schema": {
|
|
1342
|
+
"type": "object"
|
|
1343
|
+
}
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
"name": "get_optimization_hints",
|
|
1347
|
+
"description": "Get suggested MySQL optimizer hints for a specific optimization goal (SPEED, MEMORY, or STABILITY).",
|
|
1348
|
+
"input_schema": {
|
|
1349
|
+
"type": "object",
|
|
1350
|
+
"properties": {
|
|
1351
|
+
"goal": {
|
|
1352
|
+
"type": "string",
|
|
1353
|
+
"enum": [
|
|
1354
|
+
"SPEED",
|
|
1355
|
+
"MEMORY",
|
|
1356
|
+
"STABILITY"
|
|
1357
|
+
],
|
|
1358
|
+
"description": "Optimization goal: SPEED for faster queries, MEMORY for lower memory usage, STABILITY for consistent performance"
|
|
1359
|
+
}
|
|
1360
|
+
},
|
|
1361
|
+
"required": [
|
|
1362
|
+
"goal"
|
|
1363
|
+
]
|
|
1364
|
+
},
|
|
1365
|
+
"output_schema": {
|
|
1366
|
+
"type": "object"
|
|
1367
|
+
}
|
|
1368
|
+
},
|
|
1369
|
+
{
|
|
1370
|
+
"name": "list_views",
|
|
1371
|
+
"description": "Lists all views in the connected database.",
|
|
1372
|
+
"input_schema": {
|
|
1373
|
+
"type": "object",
|
|
1374
|
+
"properties": {
|
|
1375
|
+
"database": {
|
|
1376
|
+
"type": "string",
|
|
1377
|
+
"description": "Optional: specific database name"
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
},
|
|
1381
|
+
"output_schema": {
|
|
1382
|
+
"type": "object"
|
|
1383
|
+
}
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
"name": "get_view_info",
|
|
1387
|
+
"description": "Gets detailed information about a specific view including columns and definition.",
|
|
1388
|
+
"input_schema": {
|
|
1389
|
+
"type": "object",
|
|
1390
|
+
"properties": {
|
|
1391
|
+
"view_name": {
|
|
1392
|
+
"type": "string",
|
|
1393
|
+
"description": "Name of the view"
|
|
1394
|
+
},
|
|
1395
|
+
"database": {
|
|
1396
|
+
"type": "string",
|
|
1397
|
+
"description": "Optional: specific database name"
|
|
1398
|
+
}
|
|
1399
|
+
},
|
|
1400
|
+
"required": [
|
|
1401
|
+
"view_name"
|
|
1402
|
+
]
|
|
1403
|
+
},
|
|
1404
|
+
"output_schema": {
|
|
1405
|
+
"type": "object"
|
|
1406
|
+
}
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
"name": "create_view",
|
|
1410
|
+
"description": "Creates a new view with the specified SELECT definition. Requires 'ddl' permission.",
|
|
1411
|
+
"input_schema": {
|
|
1412
|
+
"type": "object",
|
|
1413
|
+
"properties": {
|
|
1414
|
+
"view_name": {
|
|
1415
|
+
"type": "string",
|
|
1416
|
+
"description": "Name of the view to create"
|
|
1417
|
+
},
|
|
1418
|
+
"definition": {
|
|
1419
|
+
"type": "string",
|
|
1420
|
+
"description": "SELECT statement that defines the view"
|
|
1421
|
+
},
|
|
1422
|
+
"or_replace": {
|
|
1423
|
+
"type": "boolean",
|
|
1424
|
+
"description": "If true, replaces existing view"
|
|
1425
|
+
},
|
|
1426
|
+
"algorithm": {
|
|
1427
|
+
"type": "string",
|
|
1428
|
+
"enum": [
|
|
1429
|
+
"UNDEFINED",
|
|
1430
|
+
"MERGE",
|
|
1431
|
+
"TEMPTABLE"
|
|
1432
|
+
],
|
|
1433
|
+
"description": "View algorithm"
|
|
1434
|
+
},
|
|
1435
|
+
"security": {
|
|
1436
|
+
"type": "string",
|
|
1437
|
+
"enum": [
|
|
1438
|
+
"DEFINER",
|
|
1439
|
+
"INVOKER"
|
|
1440
|
+
],
|
|
1441
|
+
"description": "Security context"
|
|
1442
|
+
},
|
|
1443
|
+
"check_option": {
|
|
1444
|
+
"type": "string",
|
|
1445
|
+
"enum": [
|
|
1446
|
+
"CASCADED",
|
|
1447
|
+
"LOCAL"
|
|
1448
|
+
],
|
|
1449
|
+
"description": "Check option for updatable views"
|
|
1450
|
+
},
|
|
1451
|
+
"database": {
|
|
1452
|
+
"type": "string",
|
|
1453
|
+
"description": "Optional: specific database name"
|
|
1454
|
+
}
|
|
1455
|
+
},
|
|
1456
|
+
"required": [
|
|
1457
|
+
"view_name",
|
|
1458
|
+
"definition"
|
|
1459
|
+
]
|
|
1460
|
+
},
|
|
1461
|
+
"output_schema": {
|
|
1462
|
+
"type": "object"
|
|
1463
|
+
}
|
|
1464
|
+
},
|
|
1465
|
+
{
|
|
1466
|
+
"name": "alter_view",
|
|
1467
|
+
"description": "Alters an existing view definition. Requires 'ddl' permission.",
|
|
1468
|
+
"input_schema": {
|
|
1469
|
+
"type": "object",
|
|
1470
|
+
"properties": {
|
|
1471
|
+
"view_name": {
|
|
1472
|
+
"type": "string",
|
|
1473
|
+
"description": "Name of the view to alter"
|
|
1474
|
+
},
|
|
1475
|
+
"definition": {
|
|
1476
|
+
"type": "string",
|
|
1477
|
+
"description": "New SELECT statement that defines the view"
|
|
1478
|
+
},
|
|
1479
|
+
"algorithm": {
|
|
1480
|
+
"type": "string",
|
|
1481
|
+
"enum": [
|
|
1482
|
+
"UNDEFINED",
|
|
1483
|
+
"MERGE",
|
|
1484
|
+
"TEMPTABLE"
|
|
1485
|
+
],
|
|
1486
|
+
"description": "View algorithm"
|
|
1487
|
+
},
|
|
1488
|
+
"security": {
|
|
1489
|
+
"type": "string",
|
|
1490
|
+
"enum": [
|
|
1491
|
+
"DEFINER",
|
|
1492
|
+
"INVOKER"
|
|
1493
|
+
],
|
|
1494
|
+
"description": "Security context"
|
|
1495
|
+
},
|
|
1496
|
+
"check_option": {
|
|
1497
|
+
"type": "string",
|
|
1498
|
+
"enum": [
|
|
1499
|
+
"CASCADED",
|
|
1500
|
+
"LOCAL"
|
|
1501
|
+
],
|
|
1502
|
+
"description": "Check option"
|
|
1503
|
+
},
|
|
1504
|
+
"database": {
|
|
1505
|
+
"type": "string",
|
|
1506
|
+
"description": "Optional: specific database name"
|
|
1507
|
+
}
|
|
1508
|
+
},
|
|
1509
|
+
"required": [
|
|
1510
|
+
"view_name",
|
|
1511
|
+
"definition"
|
|
1512
|
+
]
|
|
1513
|
+
},
|
|
1514
|
+
"output_schema": {
|
|
1515
|
+
"type": "object"
|
|
1516
|
+
}
|
|
1517
|
+
},
|
|
1518
|
+
{
|
|
1519
|
+
"name": "drop_view",
|
|
1520
|
+
"description": "Drops a view. Requires 'ddl' permission. WARNING: This is irreversible!",
|
|
1521
|
+
"input_schema": {
|
|
1522
|
+
"type": "object",
|
|
1523
|
+
"properties": {
|
|
1524
|
+
"view_name": {
|
|
1525
|
+
"type": "string",
|
|
1526
|
+
"description": "Name of the view to drop"
|
|
1527
|
+
},
|
|
1528
|
+
"if_exists": {
|
|
1529
|
+
"type": "boolean",
|
|
1530
|
+
"description": "If true, will not error if view does not exist"
|
|
1531
|
+
},
|
|
1532
|
+
"database": {
|
|
1533
|
+
"type": "string",
|
|
1534
|
+
"description": "Optional: specific database name"
|
|
1535
|
+
}
|
|
1536
|
+
},
|
|
1537
|
+
"required": [
|
|
1538
|
+
"view_name"
|
|
1539
|
+
]
|
|
1540
|
+
},
|
|
1541
|
+
"output_schema": {
|
|
1542
|
+
"type": "object"
|
|
1543
|
+
}
|
|
1544
|
+
},
|
|
1545
|
+
{
|
|
1546
|
+
"name": "show_create_view",
|
|
1547
|
+
"description": "Shows the CREATE statement for a view.",
|
|
1548
|
+
"input_schema": {
|
|
1549
|
+
"type": "object",
|
|
1550
|
+
"properties": {
|
|
1551
|
+
"view_name": {
|
|
1552
|
+
"type": "string",
|
|
1553
|
+
"description": "Name of the view"
|
|
1554
|
+
},
|
|
1555
|
+
"database": {
|
|
1556
|
+
"type": "string",
|
|
1557
|
+
"description": "Optional: specific database name"
|
|
1558
|
+
}
|
|
1559
|
+
},
|
|
1560
|
+
"required": [
|
|
1561
|
+
"view_name"
|
|
1562
|
+
]
|
|
1563
|
+
},
|
|
1564
|
+
"output_schema": {
|
|
1565
|
+
"type": "object"
|
|
1566
|
+
}
|
|
1567
|
+
},
|
|
1568
|
+
{
|
|
1569
|
+
"name": "list_triggers",
|
|
1570
|
+
"description": "Lists all triggers in the database, optionally filtered by table.",
|
|
1571
|
+
"input_schema": {
|
|
1572
|
+
"type": "object",
|
|
1573
|
+
"properties": {
|
|
1574
|
+
"database": {
|
|
1575
|
+
"type": "string",
|
|
1576
|
+
"description": "Optional: specific database name"
|
|
1577
|
+
},
|
|
1578
|
+
"table_name": {
|
|
1579
|
+
"type": "string",
|
|
1580
|
+
"description": "Optional: filter triggers for specific table"
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
},
|
|
1584
|
+
"output_schema": {
|
|
1585
|
+
"type": "object"
|
|
1586
|
+
}
|
|
1587
|
+
},
|
|
1588
|
+
{
|
|
1589
|
+
"name": "get_trigger_info",
|
|
1590
|
+
"description": "Gets detailed information about a specific trigger.",
|
|
1591
|
+
"input_schema": {
|
|
1592
|
+
"type": "object",
|
|
1593
|
+
"properties": {
|
|
1594
|
+
"trigger_name": {
|
|
1595
|
+
"type": "string",
|
|
1596
|
+
"description": "Name of the trigger"
|
|
1597
|
+
},
|
|
1598
|
+
"database": {
|
|
1599
|
+
"type": "string",
|
|
1600
|
+
"description": "Optional: specific database name"
|
|
1601
|
+
}
|
|
1602
|
+
},
|
|
1603
|
+
"required": [
|
|
1604
|
+
"trigger_name"
|
|
1605
|
+
]
|
|
1606
|
+
},
|
|
1607
|
+
"output_schema": {
|
|
1608
|
+
"type": "object"
|
|
1609
|
+
}
|
|
1610
|
+
},
|
|
1611
|
+
{
|
|
1612
|
+
"name": "create_trigger",
|
|
1613
|
+
"description": "Creates a new trigger on a table. Requires 'ddl' permission.",
|
|
1614
|
+
"input_schema": {
|
|
1615
|
+
"type": "object",
|
|
1616
|
+
"properties": {
|
|
1617
|
+
"trigger_name": {
|
|
1618
|
+
"type": "string",
|
|
1619
|
+
"description": "Name of the trigger"
|
|
1620
|
+
},
|
|
1621
|
+
"table_name": {
|
|
1622
|
+
"type": "string",
|
|
1623
|
+
"description": "Table the trigger is associated with"
|
|
1624
|
+
},
|
|
1625
|
+
"timing": {
|
|
1626
|
+
"type": "string",
|
|
1627
|
+
"enum": [
|
|
1628
|
+
"BEFORE",
|
|
1629
|
+
"AFTER"
|
|
1630
|
+
],
|
|
1631
|
+
"description": "When the trigger fires"
|
|
1632
|
+
},
|
|
1633
|
+
"event": {
|
|
1634
|
+
"type": "string",
|
|
1635
|
+
"enum": [
|
|
1636
|
+
"INSERT",
|
|
1637
|
+
"UPDATE",
|
|
1638
|
+
"DELETE"
|
|
1639
|
+
],
|
|
1640
|
+
"description": "Event that fires the trigger"
|
|
1641
|
+
},
|
|
1642
|
+
"body": {
|
|
1643
|
+
"type": "string",
|
|
1644
|
+
"description": "SQL statements to execute"
|
|
1645
|
+
},
|
|
1646
|
+
"definer": {
|
|
1647
|
+
"type": "string",
|
|
1648
|
+
"description": "Optional: user who owns the trigger"
|
|
1649
|
+
},
|
|
1650
|
+
"database": {
|
|
1651
|
+
"type": "string",
|
|
1652
|
+
"description": "Optional: specific database name"
|
|
1653
|
+
}
|
|
1654
|
+
},
|
|
1655
|
+
"required": [
|
|
1656
|
+
"trigger_name",
|
|
1657
|
+
"table_name",
|
|
1658
|
+
"timing",
|
|
1659
|
+
"event",
|
|
1660
|
+
"body"
|
|
1661
|
+
]
|
|
1662
|
+
},
|
|
1663
|
+
"output_schema": {
|
|
1664
|
+
"type": "object"
|
|
1665
|
+
}
|
|
1666
|
+
},
|
|
1667
|
+
{
|
|
1668
|
+
"name": "drop_trigger",
|
|
1669
|
+
"description": "Drops a trigger. Requires 'ddl' permission. WARNING: This is irreversible!",
|
|
1670
|
+
"input_schema": {
|
|
1671
|
+
"type": "object",
|
|
1672
|
+
"properties": {
|
|
1673
|
+
"trigger_name": {
|
|
1674
|
+
"type": "string",
|
|
1675
|
+
"description": "Name of the trigger to drop"
|
|
1676
|
+
},
|
|
1677
|
+
"if_exists": {
|
|
1678
|
+
"type": "boolean",
|
|
1679
|
+
"description": "If true, will not error if trigger does not exist"
|
|
1680
|
+
},
|
|
1681
|
+
"database": {
|
|
1682
|
+
"type": "string",
|
|
1683
|
+
"description": "Optional: specific database name"
|
|
1684
|
+
}
|
|
1685
|
+
},
|
|
1686
|
+
"required": [
|
|
1687
|
+
"trigger_name"
|
|
1688
|
+
]
|
|
1689
|
+
},
|
|
1690
|
+
"output_schema": {
|
|
1691
|
+
"type": "object"
|
|
1692
|
+
}
|
|
1693
|
+
},
|
|
1694
|
+
{
|
|
1695
|
+
"name": "show_create_trigger",
|
|
1696
|
+
"description": "Shows the CREATE statement for a trigger.",
|
|
1697
|
+
"input_schema": {
|
|
1698
|
+
"type": "object",
|
|
1699
|
+
"properties": {
|
|
1700
|
+
"trigger_name": {
|
|
1701
|
+
"type": "string",
|
|
1702
|
+
"description": "Name of the trigger"
|
|
1703
|
+
},
|
|
1704
|
+
"database": {
|
|
1705
|
+
"type": "string",
|
|
1706
|
+
"description": "Optional: specific database name"
|
|
1707
|
+
}
|
|
1708
|
+
},
|
|
1709
|
+
"required": [
|
|
1710
|
+
"trigger_name"
|
|
1711
|
+
]
|
|
1712
|
+
},
|
|
1713
|
+
"output_schema": {
|
|
1714
|
+
"type": "object"
|
|
1715
|
+
}
|
|
1716
|
+
},
|
|
1717
|
+
{
|
|
1718
|
+
"name": "list_indexes",
|
|
1719
|
+
"description": "Lists all indexes for a specific table.",
|
|
1720
|
+
"input_schema": {
|
|
1721
|
+
"type": "object",
|
|
1722
|
+
"properties": {
|
|
1723
|
+
"table_name": {
|
|
1724
|
+
"type": "string",
|
|
1725
|
+
"description": "Name of the table"
|
|
1726
|
+
},
|
|
1727
|
+
"database": {
|
|
1728
|
+
"type": "string",
|
|
1729
|
+
"description": "Optional: specific database name"
|
|
1730
|
+
}
|
|
1731
|
+
},
|
|
1732
|
+
"required": [
|
|
1733
|
+
"table_name"
|
|
1734
|
+
]
|
|
1735
|
+
},
|
|
1736
|
+
"output_schema": {
|
|
1737
|
+
"type": "object"
|
|
1738
|
+
}
|
|
1739
|
+
},
|
|
1740
|
+
{
|
|
1741
|
+
"name": "get_index_info",
|
|
1742
|
+
"description": "Gets detailed information about a specific index.",
|
|
1743
|
+
"input_schema": {
|
|
1744
|
+
"type": "object",
|
|
1745
|
+
"properties": {
|
|
1746
|
+
"table_name": {
|
|
1747
|
+
"type": "string",
|
|
1748
|
+
"description": "Name of the table"
|
|
1749
|
+
},
|
|
1750
|
+
"index_name": {
|
|
1751
|
+
"type": "string",
|
|
1752
|
+
"description": "Name of the index"
|
|
1753
|
+
},
|
|
1754
|
+
"database": {
|
|
1755
|
+
"type": "string",
|
|
1756
|
+
"description": "Optional: specific database name"
|
|
1757
|
+
}
|
|
1758
|
+
},
|
|
1759
|
+
"required": [
|
|
1760
|
+
"table_name",
|
|
1761
|
+
"index_name"
|
|
1762
|
+
]
|
|
1763
|
+
},
|
|
1764
|
+
"output_schema": {
|
|
1765
|
+
"type": "object"
|
|
1766
|
+
}
|
|
1767
|
+
},
|
|
1768
|
+
{
|
|
1769
|
+
"name": "create_index",
|
|
1770
|
+
"description": "Creates a new index on a table. Requires 'ddl' permission.",
|
|
1771
|
+
"input_schema": {
|
|
1772
|
+
"type": "object",
|
|
1773
|
+
"properties": {
|
|
1774
|
+
"table_name": {
|
|
1775
|
+
"type": "string",
|
|
1776
|
+
"description": "Name of the table"
|
|
1777
|
+
},
|
|
1778
|
+
"index_name": {
|
|
1779
|
+
"type": "string",
|
|
1780
|
+
"description": "Name of the index"
|
|
1781
|
+
},
|
|
1782
|
+
"columns": {
|
|
1783
|
+
"type": "array",
|
|
1784
|
+
"description": "Columns to index (string or object with column, length, order)",
|
|
1785
|
+
"items": {}
|
|
1786
|
+
},
|
|
1787
|
+
"unique": {
|
|
1788
|
+
"type": "boolean",
|
|
1789
|
+
"description": "Whether index is unique"
|
|
1790
|
+
},
|
|
1791
|
+
"index_type": {
|
|
1792
|
+
"type": "string",
|
|
1793
|
+
"enum": [
|
|
1794
|
+
"BTREE",
|
|
1795
|
+
"HASH",
|
|
1796
|
+
"FULLTEXT",
|
|
1797
|
+
"SPATIAL"
|
|
1798
|
+
],
|
|
1799
|
+
"description": "Index type"
|
|
1800
|
+
},
|
|
1801
|
+
"comment": {
|
|
1802
|
+
"type": "string",
|
|
1803
|
+
"description": "Optional comment"
|
|
1804
|
+
},
|
|
1805
|
+
"database": {
|
|
1806
|
+
"type": "string",
|
|
1807
|
+
"description": "Optional: specific database name"
|
|
1808
|
+
}
|
|
1809
|
+
},
|
|
1810
|
+
"required": [
|
|
1811
|
+
"table_name",
|
|
1812
|
+
"index_name",
|
|
1813
|
+
"columns"
|
|
1814
|
+
]
|
|
1815
|
+
},
|
|
1816
|
+
"output_schema": {
|
|
1817
|
+
"type": "object"
|
|
1818
|
+
}
|
|
1819
|
+
},
|
|
1820
|
+
{
|
|
1821
|
+
"name": "drop_index",
|
|
1822
|
+
"description": "Drops an index from a table. Requires 'ddl' permission.",
|
|
1823
|
+
"input_schema": {
|
|
1824
|
+
"type": "object",
|
|
1825
|
+
"properties": {
|
|
1826
|
+
"table_name": {
|
|
1827
|
+
"type": "string",
|
|
1828
|
+
"description": "Name of the table"
|
|
1829
|
+
},
|
|
1830
|
+
"index_name": {
|
|
1831
|
+
"type": "string",
|
|
1832
|
+
"description": "Name of the index to drop"
|
|
1833
|
+
},
|
|
1834
|
+
"database": {
|
|
1835
|
+
"type": "string",
|
|
1836
|
+
"description": "Optional: specific database name"
|
|
1837
|
+
}
|
|
1838
|
+
},
|
|
1839
|
+
"required": [
|
|
1840
|
+
"table_name",
|
|
1841
|
+
"index_name"
|
|
1842
|
+
]
|
|
1843
|
+
},
|
|
1844
|
+
"output_schema": {
|
|
1845
|
+
"type": "object"
|
|
1846
|
+
}
|
|
1847
|
+
},
|
|
1848
|
+
{
|
|
1849
|
+
"name": "analyze_index",
|
|
1850
|
+
"description": "Analyzes a table to update index statistics.",
|
|
1851
|
+
"input_schema": {
|
|
1852
|
+
"type": "object",
|
|
1853
|
+
"properties": {
|
|
1854
|
+
"table_name": {
|
|
1855
|
+
"type": "string",
|
|
1856
|
+
"description": "Name of the table to analyze"
|
|
1857
|
+
},
|
|
1858
|
+
"database": {
|
|
1859
|
+
"type": "string",
|
|
1860
|
+
"description": "Optional: specific database name"
|
|
1861
|
+
}
|
|
1862
|
+
},
|
|
1863
|
+
"required": [
|
|
1864
|
+
"table_name"
|
|
1865
|
+
]
|
|
1866
|
+
},
|
|
1867
|
+
"output_schema": {
|
|
1868
|
+
"type": "object"
|
|
1869
|
+
}
|
|
1870
|
+
},
|
|
1871
|
+
{
|
|
1872
|
+
"name": "list_foreign_keys",
|
|
1873
|
+
"description": "Lists all foreign key constraints for a table.",
|
|
1874
|
+
"input_schema": {
|
|
1875
|
+
"type": "object",
|
|
1876
|
+
"properties": {
|
|
1877
|
+
"table_name": {
|
|
1878
|
+
"type": "string",
|
|
1879
|
+
"description": "Name of the table"
|
|
1880
|
+
},
|
|
1881
|
+
"database": {
|
|
1882
|
+
"type": "string",
|
|
1883
|
+
"description": "Optional: specific database name"
|
|
1884
|
+
}
|
|
1885
|
+
},
|
|
1886
|
+
"required": [
|
|
1887
|
+
"table_name"
|
|
1888
|
+
]
|
|
1889
|
+
},
|
|
1890
|
+
"output_schema": {
|
|
1891
|
+
"type": "object"
|
|
1892
|
+
}
|
|
1893
|
+
},
|
|
1894
|
+
{
|
|
1895
|
+
"name": "list_constraints",
|
|
1896
|
+
"description": "Lists all constraints (PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK) for a table.",
|
|
1897
|
+
"input_schema": {
|
|
1898
|
+
"type": "object",
|
|
1899
|
+
"properties": {
|
|
1900
|
+
"table_name": {
|
|
1901
|
+
"type": "string",
|
|
1902
|
+
"description": "Name of the table"
|
|
1903
|
+
},
|
|
1904
|
+
"database": {
|
|
1905
|
+
"type": "string",
|
|
1906
|
+
"description": "Optional: specific database name"
|
|
1907
|
+
}
|
|
1908
|
+
},
|
|
1909
|
+
"required": [
|
|
1910
|
+
"table_name"
|
|
1911
|
+
]
|
|
1912
|
+
},
|
|
1913
|
+
"output_schema": {
|
|
1914
|
+
"type": "object"
|
|
1915
|
+
}
|
|
1916
|
+
},
|
|
1917
|
+
{
|
|
1918
|
+
"name": "add_foreign_key",
|
|
1919
|
+
"description": "Adds a foreign key constraint to a table. Requires 'ddl' permission.",
|
|
1920
|
+
"input_schema": {
|
|
1921
|
+
"type": "object",
|
|
1922
|
+
"properties": {
|
|
1923
|
+
"table_name": {
|
|
1924
|
+
"type": "string",
|
|
1925
|
+
"description": "Name of the table"
|
|
1926
|
+
},
|
|
1927
|
+
"constraint_name": {
|
|
1928
|
+
"type": "string",
|
|
1929
|
+
"description": "Name of the constraint"
|
|
1930
|
+
},
|
|
1931
|
+
"columns": {
|
|
1932
|
+
"type": "array",
|
|
1933
|
+
"items": {
|
|
1934
|
+
"type": "string"
|
|
1935
|
+
},
|
|
1936
|
+
"description": "Columns in the foreign key"
|
|
1937
|
+
},
|
|
1938
|
+
"referenced_table": {
|
|
1939
|
+
"type": "string",
|
|
1940
|
+
"description": "Referenced table name"
|
|
1941
|
+
},
|
|
1942
|
+
"referenced_columns": {
|
|
1943
|
+
"type": "array",
|
|
1944
|
+
"items": {
|
|
1945
|
+
"type": "string"
|
|
1946
|
+
},
|
|
1947
|
+
"description": "Referenced columns"
|
|
1948
|
+
},
|
|
1949
|
+
"on_delete": {
|
|
1950
|
+
"type": "string",
|
|
1951
|
+
"enum": [
|
|
1952
|
+
"CASCADE",
|
|
1953
|
+
"SET NULL",
|
|
1954
|
+
"RESTRICT",
|
|
1955
|
+
"NO ACTION",
|
|
1956
|
+
"SET DEFAULT"
|
|
1957
|
+
]
|
|
1958
|
+
},
|
|
1959
|
+
"on_update": {
|
|
1960
|
+
"type": "string",
|
|
1961
|
+
"enum": [
|
|
1962
|
+
"CASCADE",
|
|
1963
|
+
"SET NULL",
|
|
1964
|
+
"RESTRICT",
|
|
1965
|
+
"NO ACTION",
|
|
1966
|
+
"SET DEFAULT"
|
|
1967
|
+
]
|
|
1968
|
+
},
|
|
1969
|
+
"database": {
|
|
1970
|
+
"type": "string",
|
|
1971
|
+
"description": "Optional: specific database name"
|
|
1972
|
+
}
|
|
1973
|
+
},
|
|
1974
|
+
"required": [
|
|
1975
|
+
"table_name",
|
|
1976
|
+
"constraint_name",
|
|
1977
|
+
"columns",
|
|
1978
|
+
"referenced_table",
|
|
1979
|
+
"referenced_columns"
|
|
1980
|
+
]
|
|
1981
|
+
},
|
|
1982
|
+
"output_schema": {
|
|
1983
|
+
"type": "object"
|
|
1984
|
+
}
|
|
1985
|
+
},
|
|
1986
|
+
{
|
|
1987
|
+
"name": "drop_foreign_key",
|
|
1988
|
+
"description": "Drops a foreign key constraint. Requires 'ddl' permission.",
|
|
1989
|
+
"input_schema": {
|
|
1990
|
+
"type": "object",
|
|
1991
|
+
"properties": {
|
|
1992
|
+
"table_name": {
|
|
1993
|
+
"type": "string",
|
|
1994
|
+
"description": "Name of the table"
|
|
1995
|
+
},
|
|
1996
|
+
"constraint_name": {
|
|
1997
|
+
"type": "string",
|
|
1998
|
+
"description": "Name of the constraint to drop"
|
|
1999
|
+
},
|
|
2000
|
+
"database": {
|
|
2001
|
+
"type": "string",
|
|
2002
|
+
"description": "Optional: specific database name"
|
|
2003
|
+
}
|
|
2004
|
+
},
|
|
2005
|
+
"required": [
|
|
2006
|
+
"table_name",
|
|
2007
|
+
"constraint_name"
|
|
2008
|
+
]
|
|
2009
|
+
},
|
|
2010
|
+
"output_schema": {
|
|
2011
|
+
"type": "object"
|
|
2012
|
+
}
|
|
2013
|
+
},
|
|
2014
|
+
{
|
|
2015
|
+
"name": "add_unique_constraint",
|
|
2016
|
+
"description": "Adds a unique constraint to a table. Requires 'ddl' permission.",
|
|
2017
|
+
"input_schema": {
|
|
2018
|
+
"type": "object",
|
|
2019
|
+
"properties": {
|
|
2020
|
+
"table_name": {
|
|
2021
|
+
"type": "string",
|
|
2022
|
+
"description": "Name of the table"
|
|
2023
|
+
},
|
|
2024
|
+
"constraint_name": {
|
|
2025
|
+
"type": "string",
|
|
2026
|
+
"description": "Name of the constraint"
|
|
2027
|
+
},
|
|
2028
|
+
"columns": {
|
|
2029
|
+
"type": "array",
|
|
2030
|
+
"items": {
|
|
2031
|
+
"type": "string"
|
|
2032
|
+
},
|
|
2033
|
+
"description": "Columns in the unique constraint"
|
|
2034
|
+
},
|
|
2035
|
+
"database": {
|
|
2036
|
+
"type": "string",
|
|
2037
|
+
"description": "Optional: specific database name"
|
|
2038
|
+
}
|
|
2039
|
+
},
|
|
2040
|
+
"required": [
|
|
2041
|
+
"table_name",
|
|
2042
|
+
"constraint_name",
|
|
2043
|
+
"columns"
|
|
2044
|
+
]
|
|
2045
|
+
},
|
|
2046
|
+
"output_schema": {
|
|
2047
|
+
"type": "object"
|
|
2048
|
+
}
|
|
2049
|
+
},
|
|
2050
|
+
{
|
|
2051
|
+
"name": "drop_constraint",
|
|
2052
|
+
"description": "Drops a UNIQUE or CHECK constraint. Requires 'ddl' permission.",
|
|
2053
|
+
"input_schema": {
|
|
2054
|
+
"type": "object",
|
|
2055
|
+
"properties": {
|
|
2056
|
+
"table_name": {
|
|
2057
|
+
"type": "string",
|
|
2058
|
+
"description": "Name of the table"
|
|
2059
|
+
},
|
|
2060
|
+
"constraint_name": {
|
|
2061
|
+
"type": "string",
|
|
2062
|
+
"description": "Name of the constraint"
|
|
2063
|
+
},
|
|
2064
|
+
"constraint_type": {
|
|
2065
|
+
"type": "string",
|
|
2066
|
+
"enum": [
|
|
2067
|
+
"UNIQUE",
|
|
2068
|
+
"CHECK"
|
|
2069
|
+
],
|
|
2070
|
+
"description": "Type of constraint"
|
|
2071
|
+
},
|
|
2072
|
+
"database": {
|
|
2073
|
+
"type": "string",
|
|
2074
|
+
"description": "Optional: specific database name"
|
|
2075
|
+
}
|
|
2076
|
+
},
|
|
2077
|
+
"required": [
|
|
2078
|
+
"table_name",
|
|
2079
|
+
"constraint_name",
|
|
2080
|
+
"constraint_type"
|
|
2081
|
+
]
|
|
2082
|
+
},
|
|
2083
|
+
"output_schema": {
|
|
2084
|
+
"type": "object"
|
|
2085
|
+
}
|
|
2086
|
+
},
|
|
2087
|
+
{
|
|
2088
|
+
"name": "add_check_constraint",
|
|
2089
|
+
"description": "Adds a CHECK constraint to a table (MySQL 8.0.16+). Requires 'ddl' permission.",
|
|
2090
|
+
"input_schema": {
|
|
2091
|
+
"type": "object",
|
|
2092
|
+
"properties": {
|
|
2093
|
+
"table_name": {
|
|
2094
|
+
"type": "string",
|
|
2095
|
+
"description": "Name of the table"
|
|
2096
|
+
},
|
|
2097
|
+
"constraint_name": {
|
|
2098
|
+
"type": "string",
|
|
2099
|
+
"description": "Name of the constraint"
|
|
2100
|
+
},
|
|
2101
|
+
"expression": {
|
|
2102
|
+
"type": "string",
|
|
2103
|
+
"description": "Check expression (e.g., 'age >= 18')"
|
|
2104
|
+
},
|
|
2105
|
+
"enforced": {
|
|
2106
|
+
"type": "boolean",
|
|
2107
|
+
"description": "Whether constraint is enforced (default: true)"
|
|
2108
|
+
},
|
|
2109
|
+
"database": {
|
|
2110
|
+
"type": "string",
|
|
2111
|
+
"description": "Optional: specific database name"
|
|
2112
|
+
}
|
|
2113
|
+
},
|
|
2114
|
+
"required": [
|
|
2115
|
+
"table_name",
|
|
2116
|
+
"constraint_name",
|
|
2117
|
+
"expression"
|
|
2118
|
+
]
|
|
2119
|
+
},
|
|
2120
|
+
"output_schema": {
|
|
2121
|
+
"type": "object"
|
|
2122
|
+
}
|
|
2123
|
+
},
|
|
2124
|
+
{
|
|
2125
|
+
"name": "analyze_table",
|
|
2126
|
+
"description": "Analyzes a table to update index statistics for the query optimizer.",
|
|
2127
|
+
"input_schema": {
|
|
2128
|
+
"type": "object",
|
|
2129
|
+
"properties": {
|
|
2130
|
+
"table_name": {
|
|
2131
|
+
"type": "string",
|
|
2132
|
+
"description": "Name of the table to analyze"
|
|
2133
|
+
},
|
|
2134
|
+
"database": {
|
|
2135
|
+
"type": "string",
|
|
2136
|
+
"description": "Optional: specific database name"
|
|
2137
|
+
}
|
|
2138
|
+
},
|
|
2139
|
+
"required": [
|
|
2140
|
+
"table_name"
|
|
2141
|
+
]
|
|
2142
|
+
},
|
|
2143
|
+
"output_schema": {
|
|
2144
|
+
"type": "object"
|
|
2145
|
+
}
|
|
2146
|
+
},
|
|
2147
|
+
{
|
|
2148
|
+
"name": "optimize_table",
|
|
2149
|
+
"description": "Optimizes a table to reclaim unused space and defragment data.",
|
|
2150
|
+
"input_schema": {
|
|
2151
|
+
"type": "object",
|
|
2152
|
+
"properties": {
|
|
2153
|
+
"table_name": {
|
|
2154
|
+
"type": "string",
|
|
2155
|
+
"description": "Name of the table to optimize"
|
|
2156
|
+
},
|
|
2157
|
+
"database": {
|
|
2158
|
+
"type": "string",
|
|
2159
|
+
"description": "Optional: specific database name"
|
|
2160
|
+
}
|
|
2161
|
+
},
|
|
2162
|
+
"required": [
|
|
2163
|
+
"table_name"
|
|
2164
|
+
]
|
|
2165
|
+
},
|
|
2166
|
+
"output_schema": {
|
|
2167
|
+
"type": "object"
|
|
2168
|
+
}
|
|
2169
|
+
},
|
|
2170
|
+
{
|
|
2171
|
+
"name": "check_table",
|
|
2172
|
+
"description": "Checks a table for errors.",
|
|
2173
|
+
"input_schema": {
|
|
2174
|
+
"type": "object",
|
|
2175
|
+
"properties": {
|
|
2176
|
+
"table_name": {
|
|
2177
|
+
"type": "string",
|
|
2178
|
+
"description": "Name of the table to check"
|
|
2179
|
+
},
|
|
2180
|
+
"check_type": {
|
|
2181
|
+
"type": "string",
|
|
2182
|
+
"enum": [
|
|
2183
|
+
"QUICK",
|
|
2184
|
+
"FAST",
|
|
2185
|
+
"MEDIUM",
|
|
2186
|
+
"EXTENDED",
|
|
2187
|
+
"CHANGED"
|
|
2188
|
+
],
|
|
2189
|
+
"description": "Type of check"
|
|
2190
|
+
},
|
|
2191
|
+
"database": {
|
|
2192
|
+
"type": "string",
|
|
2193
|
+
"description": "Optional: specific database name"
|
|
2194
|
+
}
|
|
2195
|
+
},
|
|
2196
|
+
"required": [
|
|
2197
|
+
"table_name"
|
|
2198
|
+
]
|
|
2199
|
+
},
|
|
2200
|
+
"output_schema": {
|
|
2201
|
+
"type": "object"
|
|
2202
|
+
}
|
|
2203
|
+
},
|
|
2204
|
+
{
|
|
2205
|
+
"name": "repair_table",
|
|
2206
|
+
"description": "Repairs a corrupted table (MyISAM, ARCHIVE, CSV only).",
|
|
2207
|
+
"input_schema": {
|
|
2208
|
+
"type": "object",
|
|
2209
|
+
"properties": {
|
|
2210
|
+
"table_name": {
|
|
2211
|
+
"type": "string",
|
|
2212
|
+
"description": "Name of the table to repair"
|
|
2213
|
+
},
|
|
2214
|
+
"quick": {
|
|
2215
|
+
"type": "boolean",
|
|
2216
|
+
"description": "Quick repair"
|
|
2217
|
+
},
|
|
2218
|
+
"extended": {
|
|
2219
|
+
"type": "boolean",
|
|
2220
|
+
"description": "Extended repair"
|
|
2221
|
+
},
|
|
2222
|
+
"use_frm": {
|
|
2223
|
+
"type": "boolean",
|
|
2224
|
+
"description": "Use .frm file to repair"
|
|
2225
|
+
},
|
|
2226
|
+
"database": {
|
|
2227
|
+
"type": "string",
|
|
2228
|
+
"description": "Optional: specific database name"
|
|
2229
|
+
}
|
|
2230
|
+
},
|
|
2231
|
+
"required": [
|
|
2232
|
+
"table_name"
|
|
2233
|
+
]
|
|
2234
|
+
},
|
|
2235
|
+
"output_schema": {
|
|
2236
|
+
"type": "object"
|
|
2237
|
+
}
|
|
2238
|
+
},
|
|
2239
|
+
{
|
|
2240
|
+
"name": "truncate_table",
|
|
2241
|
+
"description": "🗑️ DESTRUCTIVE: Removes ALL rows from a table instantly (faster than DELETE). Resets auto-increment counters. Cannot be undone! Requires 'ddl' permission. ⚠️ WARNING: IRREVERSIBLE!",
|
|
2242
|
+
"input_schema": {
|
|
2243
|
+
"type": "object",
|
|
2244
|
+
"properties": {
|
|
2245
|
+
"table_name": {
|
|
2246
|
+
"type": "string",
|
|
2247
|
+
"description": "Name of the table to truncate"
|
|
2248
|
+
},
|
|
2249
|
+
"database": {
|
|
2250
|
+
"type": "string",
|
|
2251
|
+
"description": "Optional: specific database name"
|
|
2252
|
+
}
|
|
2253
|
+
},
|
|
2254
|
+
"required": [
|
|
2255
|
+
"table_name"
|
|
2256
|
+
]
|
|
2257
|
+
},
|
|
2258
|
+
"output_schema": {
|
|
2259
|
+
"type": "object"
|
|
2260
|
+
}
|
|
2261
|
+
},
|
|
2262
|
+
{
|
|
2263
|
+
"name": "get_table_status",
|
|
2264
|
+
"description": "Gets detailed status and statistics for one or all tables.",
|
|
2265
|
+
"input_schema": {
|
|
2266
|
+
"type": "object",
|
|
2267
|
+
"properties": {
|
|
2268
|
+
"table_name": {
|
|
2269
|
+
"type": "string",
|
|
2270
|
+
"description": "Optional: specific table name (omit for all tables)"
|
|
2271
|
+
},
|
|
2272
|
+
"database": {
|
|
2273
|
+
"type": "string",
|
|
2274
|
+
"description": "Optional: specific database name"
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
},
|
|
2278
|
+
"output_schema": {
|
|
2279
|
+
"type": "object"
|
|
2280
|
+
}
|
|
2281
|
+
},
|
|
2282
|
+
{
|
|
2283
|
+
"name": "flush_table",
|
|
2284
|
+
"description": "Flushes table(s) - closes and reopens them.",
|
|
2285
|
+
"input_schema": {
|
|
2286
|
+
"type": "object",
|
|
2287
|
+
"properties": {
|
|
2288
|
+
"table_name": {
|
|
2289
|
+
"type": "string",
|
|
2290
|
+
"description": "Optional: specific table (omit for all tables)"
|
|
2291
|
+
},
|
|
2292
|
+
"with_read_lock": {
|
|
2293
|
+
"type": "boolean",
|
|
2294
|
+
"description": "Acquire read lock after flushing"
|
|
2295
|
+
},
|
|
2296
|
+
"database": {
|
|
2297
|
+
"type": "string",
|
|
2298
|
+
"description": "Optional: specific database name"
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
},
|
|
2302
|
+
"output_schema": {
|
|
2303
|
+
"type": "object"
|
|
2304
|
+
}
|
|
2305
|
+
},
|
|
2306
|
+
{
|
|
2307
|
+
"name": "get_table_size",
|
|
2308
|
+
"description": "Gets size information for one or all tables including data and index sizes.",
|
|
2309
|
+
"input_schema": {
|
|
2310
|
+
"type": "object",
|
|
2311
|
+
"properties": {
|
|
2312
|
+
"table_name": {
|
|
2313
|
+
"type": "string",
|
|
2314
|
+
"description": "Optional: specific table name (omit for all tables)"
|
|
2315
|
+
},
|
|
2316
|
+
"database": {
|
|
2317
|
+
"type": "string",
|
|
2318
|
+
"description": "Optional: specific database name"
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
},
|
|
2322
|
+
"output_schema": {
|
|
2323
|
+
"type": "object"
|
|
2324
|
+
}
|
|
2325
|
+
},
|
|
2326
|
+
{
|
|
2327
|
+
"name": "create_fulltext_index",
|
|
2328
|
+
"description": "Creates a FULLTEXT index on one or more text columns in a table. Supports ngram and mecab parsers for advanced text search capabilities (useful for languages like Chinese, Japanese, Korean). Use this to enable full-text search on text columns.",
|
|
2329
|
+
"input_schema": {
|
|
2330
|
+
"type": "object",
|
|
2331
|
+
"properties": {
|
|
2332
|
+
"table_name": {
|
|
2333
|
+
"type": "string",
|
|
2334
|
+
"description": "Name of the table to create the fulltext index on"
|
|
2335
|
+
},
|
|
2336
|
+
"columns": {
|
|
2337
|
+
"type": "array",
|
|
2338
|
+
"items": {
|
|
2339
|
+
"type": "string"
|
|
2340
|
+
},
|
|
2341
|
+
"description": "Array of column names to include in the fulltext index"
|
|
2342
|
+
},
|
|
2343
|
+
"index_name": {
|
|
2344
|
+
"type": "string",
|
|
2345
|
+
"description": "Optional: custom name for the index (default: auto-generated)"
|
|
2346
|
+
},
|
|
2347
|
+
"parser": {
|
|
2348
|
+
"type": "string",
|
|
2349
|
+
"enum": [
|
|
2350
|
+
"ngram",
|
|
2351
|
+
"mecab"
|
|
2352
|
+
],
|
|
2353
|
+
"description": "Optional: parser for CJK languages (ngram or mecab)"
|
|
2354
|
+
},
|
|
2355
|
+
"ngram_token_size": {
|
|
2356
|
+
"type": "number",
|
|
2357
|
+
"description": "Optional: token size for ngram parser (default: 2)"
|
|
2358
|
+
},
|
|
2359
|
+
"database": {
|
|
2360
|
+
"type": "string",
|
|
2361
|
+
"description": "Optional: specific database name"
|
|
2362
|
+
}
|
|
2363
|
+
},
|
|
2364
|
+
"required": [
|
|
2365
|
+
"table_name",
|
|
2366
|
+
"columns"
|
|
2367
|
+
]
|
|
2368
|
+
},
|
|
2369
|
+
"output_schema": {
|
|
2370
|
+
"type": "object"
|
|
2371
|
+
}
|
|
2372
|
+
},
|
|
2373
|
+
{
|
|
2374
|
+
"name": "fulltext_search",
|
|
2375
|
+
"description": "Performs full-text search on a table using MATCH AGAINST clause. Supports natural language, boolean mode, and query expansion. Returns results ordered by relevance score. Use this for efficient text search on indexed columns.",
|
|
2376
|
+
"input_schema": {
|
|
2377
|
+
"type": "object",
|
|
2378
|
+
"properties": {
|
|
2379
|
+
"table_name": {
|
|
2380
|
+
"type": "string",
|
|
2381
|
+
"description": "Name of the table to search"
|
|
2382
|
+
},
|
|
2383
|
+
"search_term": {
|
|
2384
|
+
"type": "string",
|
|
2385
|
+
"description": "Search term or query"
|
|
2386
|
+
},
|
|
2387
|
+
"columns": {
|
|
2388
|
+
"type": "array",
|
|
2389
|
+
"items": {
|
|
2390
|
+
"type": "string"
|
|
2391
|
+
},
|
|
2392
|
+
"description": "Optional: array of column names to search (default: all fulltext indexed columns)"
|
|
2393
|
+
},
|
|
2394
|
+
"mode": {
|
|
2395
|
+
"type": "string",
|
|
2396
|
+
"enum": [
|
|
2397
|
+
"natural_language",
|
|
2398
|
+
"natural_language_with_query_expansion",
|
|
2399
|
+
"boolean",
|
|
2400
|
+
"query_expansion"
|
|
2401
|
+
],
|
|
2402
|
+
"description": "Search mode (default: natural_language)"
|
|
2403
|
+
},
|
|
2404
|
+
"limit": {
|
|
2405
|
+
"type": "number",
|
|
2406
|
+
"description": "Optional: maximum number of results (default: 100)"
|
|
2407
|
+
},
|
|
2408
|
+
"offset": {
|
|
2409
|
+
"type": "number",
|
|
2410
|
+
"description": "Optional: offset for pagination (default: 0)"
|
|
2411
|
+
},
|
|
2412
|
+
"order_by": {
|
|
2413
|
+
"type": "string",
|
|
2414
|
+
"description": "Optional: column to order by (default: relevance_score)"
|
|
2415
|
+
},
|
|
2416
|
+
"order_direction": {
|
|
2417
|
+
"type": "string",
|
|
2418
|
+
"enum": [
|
|
2419
|
+
"ASC",
|
|
2420
|
+
"DESC"
|
|
2421
|
+
],
|
|
2422
|
+
"description": "Optional: order direction (default: DESC)"
|
|
2423
|
+
},
|
|
2424
|
+
"database": {
|
|
2425
|
+
"type": "string",
|
|
2426
|
+
"description": "Optional: specific database name"
|
|
2427
|
+
}
|
|
2428
|
+
},
|
|
2429
|
+
"required": [
|
|
2430
|
+
"table_name",
|
|
2431
|
+
"search_term"
|
|
2432
|
+
]
|
|
2433
|
+
},
|
|
2434
|
+
"output_schema": {
|
|
2435
|
+
"type": "object"
|
|
2436
|
+
}
|
|
2437
|
+
},
|
|
2438
|
+
{
|
|
2439
|
+
"name": "get_fulltext_info",
|
|
2440
|
+
"description": "Retrieves information about FULLTEXT indexes on a table including index names, columns, and parser details. Use this to discover what fulltext indexes exist on a table.",
|
|
2441
|
+
"input_schema": {
|
|
2442
|
+
"type": "object",
|
|
2443
|
+
"properties": {
|
|
2444
|
+
"table_name": {
|
|
2445
|
+
"type": "string",
|
|
2446
|
+
"description": "Name of the table"
|
|
2447
|
+
},
|
|
2448
|
+
"index_name": {
|
|
2449
|
+
"type": "string",
|
|
2450
|
+
"description": "Optional: specific index name to query (default: all indexes)"
|
|
2451
|
+
},
|
|
2452
|
+
"database": {
|
|
2453
|
+
"type": "string",
|
|
2454
|
+
"description": "Optional: specific database name"
|
|
2455
|
+
}
|
|
2456
|
+
},
|
|
2457
|
+
"required": [
|
|
2458
|
+
"table_name"
|
|
2459
|
+
]
|
|
2460
|
+
},
|
|
2461
|
+
"output_schema": {
|
|
2462
|
+
"type": "object"
|
|
2463
|
+
}
|
|
2464
|
+
},
|
|
2465
|
+
{
|
|
2466
|
+
"name": "drop_fulltext_index",
|
|
2467
|
+
"description": "Drops a FULLTEXT index from a table. Use this to remove a fulltext index that is no longer needed.",
|
|
2468
|
+
"input_schema": {
|
|
2469
|
+
"type": "object",
|
|
2470
|
+
"properties": {
|
|
2471
|
+
"table_name": {
|
|
2472
|
+
"type": "string",
|
|
2473
|
+
"description": "Name of the table"
|
|
2474
|
+
},
|
|
2475
|
+
"index_name": {
|
|
2476
|
+
"type": "string",
|
|
2477
|
+
"description": "Optional: name of the index to drop (default: first fulltext index found)"
|
|
2478
|
+
},
|
|
2479
|
+
"database": {
|
|
2480
|
+
"type": "string",
|
|
2481
|
+
"description": "Optional: specific database name"
|
|
2482
|
+
}
|
|
2483
|
+
},
|
|
2484
|
+
"required": [
|
|
2485
|
+
"table_name"
|
|
2486
|
+
]
|
|
2487
|
+
},
|
|
2488
|
+
"output_schema": {
|
|
2489
|
+
"type": "object"
|
|
2490
|
+
}
|
|
2491
|
+
},
|
|
2492
|
+
{
|
|
2493
|
+
"name": "get_fulltext_stats",
|
|
2494
|
+
"description": "Retrieves statistics for FULLTEXT indexes on a table including document count, size, and key length. Use this to analyze index performance and size.",
|
|
2495
|
+
"input_schema": {
|
|
2496
|
+
"type": "object",
|
|
2497
|
+
"properties": {
|
|
2498
|
+
"table_name": {
|
|
2499
|
+
"type": "string",
|
|
2500
|
+
"description": "Name of the table"
|
|
2501
|
+
},
|
|
2502
|
+
"database": {
|
|
2503
|
+
"type": "string",
|
|
2504
|
+
"description": "Optional: specific database name"
|
|
2505
|
+
}
|
|
2506
|
+
},
|
|
2507
|
+
"required": [
|
|
2508
|
+
"table_name"
|
|
2509
|
+
]
|
|
2510
|
+
},
|
|
2511
|
+
"output_schema": {
|
|
2512
|
+
"type": "object"
|
|
2513
|
+
}
|
|
2514
|
+
},
|
|
2515
|
+
{
|
|
2516
|
+
"name": "optimize_fulltext",
|
|
2517
|
+
"description": "Optimizes a table to update FULLTEXT index statistics and reclaim space. Use this after bulk inserts or updates to improve search performance.",
|
|
2518
|
+
"input_schema": {
|
|
2519
|
+
"type": "object",
|
|
2520
|
+
"properties": {
|
|
2521
|
+
"table_name": {
|
|
2522
|
+
"type": "string",
|
|
2523
|
+
"description": "Name of the table to optimize"
|
|
2524
|
+
},
|
|
2525
|
+
"database": {
|
|
2526
|
+
"type": "string",
|
|
2527
|
+
"description": "Optional: specific database name"
|
|
2528
|
+
}
|
|
2529
|
+
},
|
|
2530
|
+
"required": [
|
|
2531
|
+
"table_name"
|
|
2532
|
+
]
|
|
2533
|
+
},
|
|
2534
|
+
"output_schema": {
|
|
2535
|
+
"type": "object"
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2538
|
+
]
|
|
733
2539
|
}
|