@jessejoris/mcp-mysql-via-api 1.0.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/PRD.md +364 -0
- package/README.md +202 -0
- package/bin/mcp-mysql-via-api.js +4 -0
- package/dist/api-client/mysqlApiClient.d.ts +46 -0
- package/dist/api-client/mysqlApiClient.js +318 -0
- package/dist/config/config.d.ts +10 -0
- package/dist/config/config.js +56 -0
- package/dist/formatters/jsonResponse.d.ts +48 -0
- package/dist/formatters/jsonResponse.js +86 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +25 -0
- package/dist/mcp-server.d.ts +2 -0
- package/dist/mcp-server.js +75 -0
- package/dist/permissions/permissionManager.d.ts +25 -0
- package/dist/permissions/permissionManager.js +199 -0
- package/dist/server/apiServer.d.ts +7 -0
- package/dist/server/apiServer.js +1502 -0
- package/dist/server/dbPool.d.ts +12 -0
- package/dist/server/dbPool.js +53 -0
- package/dist/server/standalone.d.ts +1 -0
- package/dist/server/standalone.js +19 -0
- package/dist/tools/toolDefinitions.d.ts +5 -0
- package/dist/tools/toolDefinitions.js +725 -0
- package/dist/tools/toolHandlers.d.ts +16 -0
- package/dist/tools/toolHandlers.js +285 -0
- package/dist/types/index.d.ts +184 -0
- package/dist/types/index.js +5 -0
- package/package.json +64 -0
|
@@ -0,0 +1,725 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TOOL_DEFINITIONS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Complete catalog of MCP tools exposed to AI Agents (Hermes, OpenClaw, Cursor, Claude, etc.)
|
|
6
|
+
*/
|
|
7
|
+
exports.TOOL_DEFINITIONS = [
|
|
8
|
+
// --- Discovery Tools ---
|
|
9
|
+
{
|
|
10
|
+
name: "list_databases",
|
|
11
|
+
description: "Lists all available MySQL databases accessible via the remote API.",
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: "list_tables",
|
|
19
|
+
description: "Lists all tables in the specified or default database.",
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: {
|
|
23
|
+
database: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Optional: database name to list tables from",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "read_table_schema",
|
|
32
|
+
description: "Returns the schema for a specific table including columns, data types, nullability, default values, primary keys, and indexes.",
|
|
33
|
+
inputSchema: {
|
|
34
|
+
type: "object",
|
|
35
|
+
properties: {
|
|
36
|
+
table_name: {
|
|
37
|
+
type: "string",
|
|
38
|
+
description: "The name of the table to inspect",
|
|
39
|
+
},
|
|
40
|
+
database: {
|
|
41
|
+
type: "string",
|
|
42
|
+
description: "Optional: database name",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
required: ["table_name"],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "get_database_summary",
|
|
50
|
+
description: "Provides a high-level summary of all tables, approximate row counts, column types, and foreign key relationships.",
|
|
51
|
+
inputSchema: {
|
|
52
|
+
type: "object",
|
|
53
|
+
properties: {
|
|
54
|
+
database: {
|
|
55
|
+
type: "string",
|
|
56
|
+
description: "Optional: database name",
|
|
57
|
+
},
|
|
58
|
+
max_tables: {
|
|
59
|
+
type: "number",
|
|
60
|
+
description: "Optional: maximum tables to summarize (default: 50, max 200)",
|
|
61
|
+
},
|
|
62
|
+
include_relationships: {
|
|
63
|
+
type: "boolean",
|
|
64
|
+
description: "Optional: include foreign key relationships (default: true)",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "get_schema_erd",
|
|
71
|
+
description: "Generates a Mermaid.js ER diagram representing tables and foreign key relationships.",
|
|
72
|
+
inputSchema: {
|
|
73
|
+
type: "object",
|
|
74
|
+
properties: {
|
|
75
|
+
database: {
|
|
76
|
+
type: "string",
|
|
77
|
+
description: "Optional: database name",
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "get_schema_rag_context",
|
|
84
|
+
description: "🎯 AI-OPTIMIZED: Returns ultra-compact schema information (tables, columns, keys, relationships, row estimates) designed specifically for LLM context windows (Hermes AI, OpenClaw, IDEs). Use keyword_filter for concept-focused schema discovery.",
|
|
85
|
+
inputSchema: {
|
|
86
|
+
type: "object",
|
|
87
|
+
properties: {
|
|
88
|
+
database: {
|
|
89
|
+
type: "string",
|
|
90
|
+
description: "Optional: database name",
|
|
91
|
+
},
|
|
92
|
+
max_tables: {
|
|
93
|
+
type: "number",
|
|
94
|
+
description: "Optional: maximum tables to include (default: 50, max: 200)",
|
|
95
|
+
},
|
|
96
|
+
max_columns: {
|
|
97
|
+
type: "number",
|
|
98
|
+
description: "Optional: maximum columns per table (default: 15, max: 100)",
|
|
99
|
+
},
|
|
100
|
+
keyword_filter: {
|
|
101
|
+
type: "string",
|
|
102
|
+
description: "Optional: concept keyword to filter relevant tables",
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "get_all_tables_relationships",
|
|
109
|
+
description: "Extracts all foreign key relationships between tables in the database.",
|
|
110
|
+
inputSchema: {
|
|
111
|
+
type: "object",
|
|
112
|
+
properties: {
|
|
113
|
+
database: {
|
|
114
|
+
type: "string",
|
|
115
|
+
description: "Optional: database name",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "search_schema",
|
|
122
|
+
description: "Searches for matching keywords across table names and column names.",
|
|
123
|
+
inputSchema: {
|
|
124
|
+
type: "object",
|
|
125
|
+
properties: {
|
|
126
|
+
query: {
|
|
127
|
+
type: "string",
|
|
128
|
+
description: "Search keyword to locate in tables or column names",
|
|
129
|
+
},
|
|
130
|
+
database: {
|
|
131
|
+
type: "string",
|
|
132
|
+
description: "Optional: database name",
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
required: ["query"],
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: "find_tables_by_keyword",
|
|
140
|
+
description: "Fast keyword lookup to find relevant tables by domain concept (e.g. 'order', 'user', 'invoice').",
|
|
141
|
+
inputSchema: {
|
|
142
|
+
type: "object",
|
|
143
|
+
properties: {
|
|
144
|
+
keyword: {
|
|
145
|
+
type: "string",
|
|
146
|
+
description: "Keyword to search for",
|
|
147
|
+
},
|
|
148
|
+
database: {
|
|
149
|
+
type: "string",
|
|
150
|
+
description: "Optional: database name",
|
|
151
|
+
},
|
|
152
|
+
limit: {
|
|
153
|
+
type: "number",
|
|
154
|
+
description: "Maximum results (default: 20)",
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
required: ["keyword"],
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "search_data_across_tables",
|
|
162
|
+
description: "🔍 Guarded read-only keyword scan across text-like column values across tables. Discovers which table contains specific values or IDs when table structure is unknown.",
|
|
163
|
+
inputSchema: {
|
|
164
|
+
type: "object",
|
|
165
|
+
properties: {
|
|
166
|
+
keyword: {
|
|
167
|
+
type: "string",
|
|
168
|
+
description: "Keyword or value to search across tables",
|
|
169
|
+
},
|
|
170
|
+
tables: {
|
|
171
|
+
type: "array",
|
|
172
|
+
items: { type: "string" },
|
|
173
|
+
description: "Optional list of tables to search within",
|
|
174
|
+
},
|
|
175
|
+
database: {
|
|
176
|
+
type: "string",
|
|
177
|
+
description: "Optional: database name",
|
|
178
|
+
},
|
|
179
|
+
max_tables: {
|
|
180
|
+
type: "number",
|
|
181
|
+
description: "Maximum tables to scan (default: 20, max: 100)",
|
|
182
|
+
},
|
|
183
|
+
limit_per_table: {
|
|
184
|
+
type: "number",
|
|
185
|
+
description: "Maximum rows returned per table (default: 5, max: 50)",
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
required: ["keyword"],
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
// --- CRUD Tools with Default Pagination and Bypass ---
|
|
192
|
+
{
|
|
193
|
+
name: "read_records",
|
|
194
|
+
description: "Queries rows from a table with filters/conditions, sorting, column selection, and PAGINATION. By default, results are paginated (page=1, limit=50). Set bypass_pagination=true (or all=true) to retrieve all rows without pagination.",
|
|
195
|
+
inputSchema: {
|
|
196
|
+
type: "object",
|
|
197
|
+
properties: {
|
|
198
|
+
table_name: {
|
|
199
|
+
type: "string",
|
|
200
|
+
description: "Table name to query",
|
|
201
|
+
},
|
|
202
|
+
columns: {
|
|
203
|
+
type: "array",
|
|
204
|
+
items: { type: "string" },
|
|
205
|
+
description: "Optional list of columns to retrieve",
|
|
206
|
+
},
|
|
207
|
+
filters: {
|
|
208
|
+
type: "array",
|
|
209
|
+
items: {
|
|
210
|
+
type: "object",
|
|
211
|
+
properties: {
|
|
212
|
+
field: { type: "string" },
|
|
213
|
+
operator: {
|
|
214
|
+
type: "string",
|
|
215
|
+
description: "Comparison operator: =, !=, <>, >, >=, <, <=, LIKE, IN, NOT IN, IS NULL, IS NOT NULL, BETWEEN, or legacy eq, neq, gt, gte, lt, lte, like, in",
|
|
216
|
+
},
|
|
217
|
+
value: {},
|
|
218
|
+
secondValue: {},
|
|
219
|
+
},
|
|
220
|
+
required: ["field", "operator"],
|
|
221
|
+
},
|
|
222
|
+
description: "Optional filter clauses (alias: conditions)",
|
|
223
|
+
},
|
|
224
|
+
conditions: {
|
|
225
|
+
type: "array",
|
|
226
|
+
description: "Optional filter conditions (alias for filters)",
|
|
227
|
+
},
|
|
228
|
+
sorting: {
|
|
229
|
+
type: "object",
|
|
230
|
+
properties: {
|
|
231
|
+
field: { type: "string" },
|
|
232
|
+
direction: { type: "string", enum: ["asc", "desc", "ASC", "DESC"] },
|
|
233
|
+
},
|
|
234
|
+
required: ["field", "direction"],
|
|
235
|
+
description: "Optional order by clause",
|
|
236
|
+
},
|
|
237
|
+
pagination: {
|
|
238
|
+
type: "object",
|
|
239
|
+
properties: {
|
|
240
|
+
page: { type: "number", description: "Page number (1-based, default: 1)" },
|
|
241
|
+
limit: { type: "number", description: "Rows per page (default: 50, max: 500)" },
|
|
242
|
+
},
|
|
243
|
+
description: "Pagination controls",
|
|
244
|
+
},
|
|
245
|
+
bypass_pagination: {
|
|
246
|
+
type: "boolean",
|
|
247
|
+
description: "Set to TRUE to bypass pagination and fetch the entire dataset (up to MAX_BYPASS_LIMIT)",
|
|
248
|
+
},
|
|
249
|
+
all: {
|
|
250
|
+
type: "boolean",
|
|
251
|
+
description: "Alias for bypass_pagination: true",
|
|
252
|
+
},
|
|
253
|
+
database: {
|
|
254
|
+
type: "string",
|
|
255
|
+
description: "Optional: database name",
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
required: ["table_name"],
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: "read_record",
|
|
263
|
+
description: "Fetches a single record by primary key or ID from a table via API. Fast direct point lookup.",
|
|
264
|
+
inputSchema: {
|
|
265
|
+
type: "object",
|
|
266
|
+
properties: {
|
|
267
|
+
table_name: {
|
|
268
|
+
type: "string",
|
|
269
|
+
description: "Table name to query",
|
|
270
|
+
},
|
|
271
|
+
id: {
|
|
272
|
+
description: "Primary key value or record ID",
|
|
273
|
+
},
|
|
274
|
+
key_column: {
|
|
275
|
+
type: "string",
|
|
276
|
+
description: "Optional primary key column name (auto-detected if omitted)",
|
|
277
|
+
},
|
|
278
|
+
database: {
|
|
279
|
+
type: "string",
|
|
280
|
+
description: "Optional: database name",
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
required: ["table_name", "id"],
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
name: "count_records",
|
|
288
|
+
description: "Returns the total number of records in a table matching optional filter criteria.",
|
|
289
|
+
inputSchema: {
|
|
290
|
+
type: "object",
|
|
291
|
+
properties: {
|
|
292
|
+
table_name: {
|
|
293
|
+
type: "string",
|
|
294
|
+
description: "Table name",
|
|
295
|
+
},
|
|
296
|
+
filters: {
|
|
297
|
+
type: "array",
|
|
298
|
+
description: "Optional filter clauses (or conditions)",
|
|
299
|
+
},
|
|
300
|
+
conditions: {
|
|
301
|
+
type: "array",
|
|
302
|
+
description: "Alias for filters",
|
|
303
|
+
},
|
|
304
|
+
database: {
|
|
305
|
+
type: "string",
|
|
306
|
+
description: "Optional: database name",
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
required: ["table_name"],
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
name: "create_record",
|
|
314
|
+
description: "Inserts a single new record into a table. Requires 'create' permission.",
|
|
315
|
+
inputSchema: {
|
|
316
|
+
type: "object",
|
|
317
|
+
properties: {
|
|
318
|
+
table_name: {
|
|
319
|
+
type: "string",
|
|
320
|
+
description: "Table name",
|
|
321
|
+
},
|
|
322
|
+
data: {
|
|
323
|
+
type: "object",
|
|
324
|
+
description: "Object containing column-value pairs to insert",
|
|
325
|
+
},
|
|
326
|
+
database: {
|
|
327
|
+
type: "string",
|
|
328
|
+
description: "Optional: database name",
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
required: ["table_name", "data"],
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
name: "bulk_insert",
|
|
336
|
+
description: "Inserts multiple new records into a table in a single batch. Requires 'create' permission.",
|
|
337
|
+
inputSchema: {
|
|
338
|
+
type: "object",
|
|
339
|
+
properties: {
|
|
340
|
+
table_name: {
|
|
341
|
+
type: "string",
|
|
342
|
+
description: "Table name",
|
|
343
|
+
},
|
|
344
|
+
records: {
|
|
345
|
+
type: "array",
|
|
346
|
+
items: { type: "object" },
|
|
347
|
+
description: "Array of record objects to insert",
|
|
348
|
+
},
|
|
349
|
+
database: {
|
|
350
|
+
type: "string",
|
|
351
|
+
description: "Optional: database name",
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
required: ["table_name", "records"],
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
name: "update_record",
|
|
359
|
+
description: "Updates records in a table matching filter criteria. Requires 'update' permission.",
|
|
360
|
+
inputSchema: {
|
|
361
|
+
type: "object",
|
|
362
|
+
properties: {
|
|
363
|
+
table_name: {
|
|
364
|
+
type: "string",
|
|
365
|
+
description: "Table name",
|
|
366
|
+
},
|
|
367
|
+
data: {
|
|
368
|
+
type: "object",
|
|
369
|
+
description: "Column-value pairs to update",
|
|
370
|
+
},
|
|
371
|
+
filters: {
|
|
372
|
+
type: "array",
|
|
373
|
+
description: "Filter clauses to specify which rows to update (cannot be empty for safety)",
|
|
374
|
+
},
|
|
375
|
+
conditions: {
|
|
376
|
+
type: "array",
|
|
377
|
+
description: "Alias for filters",
|
|
378
|
+
},
|
|
379
|
+
database: {
|
|
380
|
+
type: "string",
|
|
381
|
+
description: "Optional: database name",
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
required: ["table_name", "data"],
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
name: "bulk_update",
|
|
389
|
+
description: "Updates multiple records using their primary key column. Requires 'update' permission.",
|
|
390
|
+
inputSchema: {
|
|
391
|
+
type: "object",
|
|
392
|
+
properties: {
|
|
393
|
+
table_name: {
|
|
394
|
+
type: "string",
|
|
395
|
+
description: "Table name",
|
|
396
|
+
},
|
|
397
|
+
records: {
|
|
398
|
+
type: "array",
|
|
399
|
+
items: { type: "object" },
|
|
400
|
+
description: "Records containing the key_column and fields to update",
|
|
401
|
+
},
|
|
402
|
+
key_column: {
|
|
403
|
+
type: "string",
|
|
404
|
+
description: "Primary key or unique column name",
|
|
405
|
+
},
|
|
406
|
+
database: {
|
|
407
|
+
type: "string",
|
|
408
|
+
description: "Optional: database name",
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
required: ["table_name", "records", "key_column"],
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
name: "delete_record",
|
|
416
|
+
description: "Deletes records from a table matching filter criteria. Requires 'delete' permission.",
|
|
417
|
+
inputSchema: {
|
|
418
|
+
type: "object",
|
|
419
|
+
properties: {
|
|
420
|
+
table_name: {
|
|
421
|
+
type: "string",
|
|
422
|
+
description: "Table name",
|
|
423
|
+
},
|
|
424
|
+
filters: {
|
|
425
|
+
type: "array",
|
|
426
|
+
description: "Filter clauses specifying which rows to delete (cannot be empty)",
|
|
427
|
+
},
|
|
428
|
+
conditions: {
|
|
429
|
+
type: "array",
|
|
430
|
+
description: "Alias for filters",
|
|
431
|
+
},
|
|
432
|
+
database: {
|
|
433
|
+
type: "string",
|
|
434
|
+
description: "Optional: database name",
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
required: ["table_name"],
|
|
438
|
+
},
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
name: "bulk_delete",
|
|
442
|
+
description: "Deletes multiple records matching a list of primary keys. Requires 'delete' permission.",
|
|
443
|
+
inputSchema: {
|
|
444
|
+
type: "object",
|
|
445
|
+
properties: {
|
|
446
|
+
table_name: {
|
|
447
|
+
type: "string",
|
|
448
|
+
description: "Table name",
|
|
449
|
+
},
|
|
450
|
+
key_column: {
|
|
451
|
+
type: "string",
|
|
452
|
+
description: "Primary key column name",
|
|
453
|
+
},
|
|
454
|
+
keys: {
|
|
455
|
+
type: "array",
|
|
456
|
+
items: {},
|
|
457
|
+
description: "Array of key values to delete",
|
|
458
|
+
},
|
|
459
|
+
database: {
|
|
460
|
+
type: "string",
|
|
461
|
+
description: "Optional: database name",
|
|
462
|
+
},
|
|
463
|
+
},
|
|
464
|
+
required: ["table_name", "key_column", "keys"],
|
|
465
|
+
},
|
|
466
|
+
},
|
|
467
|
+
// --- Data Analysis Tools ---
|
|
468
|
+
{
|
|
469
|
+
name: "get_column_statistics",
|
|
470
|
+
description: "Returns detailed statistical analysis for a specific column: total rows, non-null count, null percentage, distinct count, min/max values, and top frequent values. Essential for data profiling.",
|
|
471
|
+
inputSchema: {
|
|
472
|
+
type: "object",
|
|
473
|
+
properties: {
|
|
474
|
+
table_name: {
|
|
475
|
+
type: "string",
|
|
476
|
+
description: "Table name",
|
|
477
|
+
},
|
|
478
|
+
column_name: {
|
|
479
|
+
type: "string",
|
|
480
|
+
description: "Column name to analyze",
|
|
481
|
+
},
|
|
482
|
+
database: {
|
|
483
|
+
type: "string",
|
|
484
|
+
description: "Optional: database name",
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
required: ["table_name", "column_name"],
|
|
488
|
+
},
|
|
489
|
+
},
|
|
490
|
+
// --- Query Management Tools ---
|
|
491
|
+
{
|
|
492
|
+
name: "run_select_query",
|
|
493
|
+
description: "Executes a read-only SELECT SQL query via API. Supports pagination (default page=1, limit=50) and bypass_pagination=true (or all=true). Requires 'read' permission.",
|
|
494
|
+
inputSchema: {
|
|
495
|
+
type: "object",
|
|
496
|
+
properties: {
|
|
497
|
+
query: {
|
|
498
|
+
type: "string",
|
|
499
|
+
description: "SQL SELECT query to execute",
|
|
500
|
+
},
|
|
501
|
+
params: {
|
|
502
|
+
type: "array",
|
|
503
|
+
description: "Optional parameterized query values",
|
|
504
|
+
},
|
|
505
|
+
page: {
|
|
506
|
+
type: "number",
|
|
507
|
+
description: "Page number (default: 1)",
|
|
508
|
+
},
|
|
509
|
+
limit: {
|
|
510
|
+
type: "number",
|
|
511
|
+
description: "Rows per page (default: 50, max: 500)",
|
|
512
|
+
},
|
|
513
|
+
bypass_pagination: {
|
|
514
|
+
type: "boolean",
|
|
515
|
+
description: "Set to TRUE to return the entire result set without pagination",
|
|
516
|
+
},
|
|
517
|
+
all: {
|
|
518
|
+
type: "boolean",
|
|
519
|
+
description: "Alias for bypass_pagination",
|
|
520
|
+
},
|
|
521
|
+
database: {
|
|
522
|
+
type: "string",
|
|
523
|
+
description: "Optional: database name",
|
|
524
|
+
},
|
|
525
|
+
},
|
|
526
|
+
required: ["query"],
|
|
527
|
+
},
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
name: "execute_write_query",
|
|
531
|
+
description: "Executes an INSERT, UPDATE, or mutation SQL query via API. Requires 'execute' permission (and 'delete' if query contains DELETE, 'ddl' if query contains DDL).",
|
|
532
|
+
inputSchema: {
|
|
533
|
+
type: "object",
|
|
534
|
+
properties: {
|
|
535
|
+
query: {
|
|
536
|
+
type: "string",
|
|
537
|
+
description: "SQL mutation statement to execute",
|
|
538
|
+
},
|
|
539
|
+
params: {
|
|
540
|
+
type: "array",
|
|
541
|
+
description: "Optional parameterized query values",
|
|
542
|
+
},
|
|
543
|
+
database: {
|
|
544
|
+
type: "string",
|
|
545
|
+
description: "Optional: database name",
|
|
546
|
+
},
|
|
547
|
+
},
|
|
548
|
+
required: ["query"],
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
// --- Schema DDL Tools ---
|
|
552
|
+
{
|
|
553
|
+
name: "create_table",
|
|
554
|
+
description: "Creates a new table via API. Requires 'ddl' permission.",
|
|
555
|
+
inputSchema: {
|
|
556
|
+
type: "object",
|
|
557
|
+
properties: {
|
|
558
|
+
table_name: {
|
|
559
|
+
type: "string",
|
|
560
|
+
description: "New table name",
|
|
561
|
+
},
|
|
562
|
+
columns: {
|
|
563
|
+
type: "array",
|
|
564
|
+
items: {
|
|
565
|
+
type: "object",
|
|
566
|
+
properties: {
|
|
567
|
+
name: { type: "string" },
|
|
568
|
+
type: { type: "string" },
|
|
569
|
+
nullable: { type: "boolean" },
|
|
570
|
+
defaultValue: {},
|
|
571
|
+
autoIncrement: { type: "boolean" },
|
|
572
|
+
primaryKey: { type: "boolean" },
|
|
573
|
+
},
|
|
574
|
+
required: ["name", "type"],
|
|
575
|
+
},
|
|
576
|
+
description: "Array of column definitions",
|
|
577
|
+
},
|
|
578
|
+
primary_key: {
|
|
579
|
+
description: "Primary key column name or array of column names",
|
|
580
|
+
},
|
|
581
|
+
database: {
|
|
582
|
+
type: "string",
|
|
583
|
+
description: "Optional: database name",
|
|
584
|
+
},
|
|
585
|
+
},
|
|
586
|
+
required: ["table_name", "columns"],
|
|
587
|
+
},
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
name: "alter_table",
|
|
591
|
+
description: "Modifies an existing table (add column, drop column, change column) via API. Requires 'ddl' permission.",
|
|
592
|
+
inputSchema: {
|
|
593
|
+
type: "object",
|
|
594
|
+
properties: {
|
|
595
|
+
table_name: {
|
|
596
|
+
type: "string",
|
|
597
|
+
description: "Target table name",
|
|
598
|
+
},
|
|
599
|
+
action: {
|
|
600
|
+
type: "string",
|
|
601
|
+
enum: ["add_column", "drop_column", "modify_column"],
|
|
602
|
+
description: "DDL alteration type",
|
|
603
|
+
},
|
|
604
|
+
column_definition: {
|
|
605
|
+
type: "object",
|
|
606
|
+
description: "Column details (name, type, nullable, etc.)",
|
|
607
|
+
},
|
|
608
|
+
database: {
|
|
609
|
+
type: "string",
|
|
610
|
+
description: "Optional: database name",
|
|
611
|
+
},
|
|
612
|
+
},
|
|
613
|
+
required: ["table_name", "action", "column_definition"],
|
|
614
|
+
},
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
name: "drop_table",
|
|
618
|
+
description: "Drops an existing table via API. Requires 'ddl' permission.",
|
|
619
|
+
inputSchema: {
|
|
620
|
+
type: "object",
|
|
621
|
+
properties: {
|
|
622
|
+
table_name: {
|
|
623
|
+
type: "string",
|
|
624
|
+
description: "Table to drop",
|
|
625
|
+
},
|
|
626
|
+
if_exists: {
|
|
627
|
+
type: "boolean",
|
|
628
|
+
description: "Whether to include IF EXISTS (default: true)",
|
|
629
|
+
},
|
|
630
|
+
database: {
|
|
631
|
+
type: "string",
|
|
632
|
+
description: "Optional: database name",
|
|
633
|
+
},
|
|
634
|
+
},
|
|
635
|
+
required: ["table_name"],
|
|
636
|
+
},
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
name: "execute_ddl",
|
|
640
|
+
description: "Executes raw DDL statement (CREATE, ALTER, DROP, TRUNCATE) via API. Requires 'ddl' permission.",
|
|
641
|
+
inputSchema: {
|
|
642
|
+
type: "object",
|
|
643
|
+
properties: {
|
|
644
|
+
query: {
|
|
645
|
+
type: "string",
|
|
646
|
+
description: "Raw DDL query",
|
|
647
|
+
},
|
|
648
|
+
database: {
|
|
649
|
+
type: "string",
|
|
650
|
+
description: "Optional: database name",
|
|
651
|
+
},
|
|
652
|
+
},
|
|
653
|
+
required: ["query"],
|
|
654
|
+
},
|
|
655
|
+
},
|
|
656
|
+
// --- Utility & Diagnostic Tools ---
|
|
657
|
+
{
|
|
658
|
+
name: "test_connection",
|
|
659
|
+
description: "Pings the remote MySQL API server and validates connectivity, latency, and credentials.",
|
|
660
|
+
inputSchema: {
|
|
661
|
+
type: "object",
|
|
662
|
+
properties: {},
|
|
663
|
+
},
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
name: "describe_connection",
|
|
667
|
+
description: "Returns the active API endpoint, server status, permission policies, and pagination defaults.",
|
|
668
|
+
inputSchema: {
|
|
669
|
+
type: "object",
|
|
670
|
+
properties: {},
|
|
671
|
+
},
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
name: "list_all_tools",
|
|
675
|
+
description: "Returns a live catalog of all available tools, their permission requirements, and active enabled/blocked status for AI agents.",
|
|
676
|
+
inputSchema: {
|
|
677
|
+
type: "object",
|
|
678
|
+
properties: {},
|
|
679
|
+
},
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
name: "export_table_to_csv",
|
|
683
|
+
description: "Exports records from a table into standard CSV format via API.",
|
|
684
|
+
inputSchema: {
|
|
685
|
+
type: "object",
|
|
686
|
+
properties: {
|
|
687
|
+
table_name: {
|
|
688
|
+
type: "string",
|
|
689
|
+
description: "Table to export",
|
|
690
|
+
},
|
|
691
|
+
limit: {
|
|
692
|
+
type: "number",
|
|
693
|
+
description: "Max rows to export (default: 1000)",
|
|
694
|
+
},
|
|
695
|
+
database: {
|
|
696
|
+
type: "string",
|
|
697
|
+
description: "Optional: database name",
|
|
698
|
+
},
|
|
699
|
+
},
|
|
700
|
+
required: ["table_name"],
|
|
701
|
+
},
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
name: "export_query_to_csv",
|
|
705
|
+
description: "Exports results of a SELECT query into standard CSV format via API.",
|
|
706
|
+
inputSchema: {
|
|
707
|
+
type: "object",
|
|
708
|
+
properties: {
|
|
709
|
+
query: {
|
|
710
|
+
type: "string",
|
|
711
|
+
description: "SELECT query to export",
|
|
712
|
+
},
|
|
713
|
+
limit: {
|
|
714
|
+
type: "number",
|
|
715
|
+
description: "Max rows to export (default: 1000)",
|
|
716
|
+
},
|
|
717
|
+
database: {
|
|
718
|
+
type: "string",
|
|
719
|
+
description: "Optional: database name",
|
|
720
|
+
},
|
|
721
|
+
},
|
|
722
|
+
required: ["query"],
|
|
723
|
+
},
|
|
724
|
+
},
|
|
725
|
+
];
|