@quarri/claude-data-tools 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/.claude-plugin/plugin.json +19 -0
- package/README.md +165 -0
- package/dist/api/client.d.ts +103 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +166 -0
- package/dist/api/client.js.map +1 -0
- package/dist/auth/cli-auth.d.ts +15 -0
- package/dist/auth/cli-auth.d.ts.map +1 -0
- package/dist/auth/cli-auth.js +170 -0
- package/dist/auth/cli-auth.js.map +1 -0
- package/dist/auth/token-store.d.ts +45 -0
- package/dist/auth/token-store.d.ts.map +1 -0
- package/dist/auth/token-store.js +154 -0
- package/dist/auth/token-store.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +157 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/definitions.d.ts +34 -0
- package/dist/tools/definitions.d.ts.map +1 -0
- package/dist/tools/definitions.js +968 -0
- package/dist/tools/definitions.js.map +1 -0
- package/package.json +52 -0
- package/skills/quarri-guide/SKILL.md +102 -0
|
@@ -0,0 +1,968 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Quarri Tool Definitions for MCP Server
|
|
4
|
+
* All tools are prefixed with 'quarri_' to avoid conflicts with other MCP servers
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.TOOL_DEFINITIONS = exports.TOOL_NAME_MAP = void 0;
|
|
8
|
+
exports.getBackendToolName = getBackendToolName;
|
|
9
|
+
exports.getToolDefinition = getToolDefinition;
|
|
10
|
+
// Map MCP tool names to backend tool names
|
|
11
|
+
exports.TOOL_NAME_MAP = {
|
|
12
|
+
// Sub-agents
|
|
13
|
+
quarri_query_agent: 'query_agent',
|
|
14
|
+
quarri_explain_agent: 'explain_agent',
|
|
15
|
+
quarri_chart_agent: 'chart_agent',
|
|
16
|
+
quarri_metric_builder_agent: 'metric_builder_agent',
|
|
17
|
+
quarri_planning_agent: 'planning_agent',
|
|
18
|
+
quarri_insight_agent: 'insight_agent',
|
|
19
|
+
quarri_stats_agent: 'stats_agent',
|
|
20
|
+
quarri_staging_agent: 'staging_agent',
|
|
21
|
+
quarri_modeling_agent: 'modeling_agent',
|
|
22
|
+
quarri_transformers_agent: 'transformers_agent',
|
|
23
|
+
quarri_extraction_agent: 'extraction_agent',
|
|
24
|
+
quarri_query_with_analysis: 'query_with_analysis',
|
|
25
|
+
// Data
|
|
26
|
+
quarri_execute_sql: 'execute_sql',
|
|
27
|
+
quarri_get_schema: 'get_schema',
|
|
28
|
+
quarri_search_values: 'search_values',
|
|
29
|
+
quarri_get_metrics: 'get_metrics',
|
|
30
|
+
quarri_create_metric: 'create_metric',
|
|
31
|
+
quarri_approve_metric: 'approve_metric',
|
|
32
|
+
quarri_get_metric_detail: 'get_metric_detail',
|
|
33
|
+
quarri_search_metrics: 'search_metrics',
|
|
34
|
+
// Config
|
|
35
|
+
quarri_list_agent_prompts: 'list_agent_prompts',
|
|
36
|
+
quarri_update_agent_prompt: 'update_agent_prompt',
|
|
37
|
+
quarri_list_rules: 'list_rules',
|
|
38
|
+
quarri_create_rule: 'create_rule',
|
|
39
|
+
quarri_update_rule: 'update_rule',
|
|
40
|
+
quarri_delete_rule: 'delete_rule',
|
|
41
|
+
quarri_vectorize_column_values: 'vectorize_column_values',
|
|
42
|
+
quarri_list_searchable_columns: 'list_searchable_columns',
|
|
43
|
+
// Canvas
|
|
44
|
+
quarri_list_canvases: 'list_canvases',
|
|
45
|
+
quarri_get_canvas: 'get_canvas',
|
|
46
|
+
quarri_create_chart_panel: 'create_chart_panel',
|
|
47
|
+
quarri_update_chart_panel: 'update_chart_panel',
|
|
48
|
+
quarri_export_canvas: 'export_canvas',
|
|
49
|
+
// Team
|
|
50
|
+
quarri_list_teams: 'list_teams',
|
|
51
|
+
quarri_get_team_filters: 'get_team_filters',
|
|
52
|
+
quarri_get_team_restrictions: 'get_team_restrictions',
|
|
53
|
+
// Extraction
|
|
54
|
+
quarri_list_extraction_sources: 'list_extraction_sources',
|
|
55
|
+
quarri_configure_extraction: 'configure_extraction',
|
|
56
|
+
quarri_discover_tables: 'discover_tables',
|
|
57
|
+
quarri_propose_transformation: 'propose_transformation',
|
|
58
|
+
quarri_upload_csv: 'upload_csv',
|
|
59
|
+
quarri_generate_quarri_schema: 'generate_quarri_schema',
|
|
60
|
+
quarri_list_raw_tables: 'list_raw_tables',
|
|
61
|
+
// Debug
|
|
62
|
+
quarri_read_server_logs: 'read_server_logs',
|
|
63
|
+
quarri_query_repl_activity: 'query_repl_activity',
|
|
64
|
+
quarri_read_fly_logs: 'read_fly_logs',
|
|
65
|
+
};
|
|
66
|
+
exports.TOOL_DEFINITIONS = [
|
|
67
|
+
// ==================== SUB-AGENT TOOLS ====================
|
|
68
|
+
{
|
|
69
|
+
name: 'quarri_query_agent',
|
|
70
|
+
description: 'Generate SQL from natural language questions. Use this when the user asks data questions.',
|
|
71
|
+
category: 'sub_agent',
|
|
72
|
+
inputSchema: {
|
|
73
|
+
type: 'object',
|
|
74
|
+
properties: {
|
|
75
|
+
question: {
|
|
76
|
+
type: 'string',
|
|
77
|
+
description: 'The natural language question to convert to SQL',
|
|
78
|
+
},
|
|
79
|
+
conversation_id: {
|
|
80
|
+
type: 'integer',
|
|
81
|
+
description: 'Optional conversation ID for multi-turn context',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
required: ['question'],
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'quarri_explain_agent',
|
|
89
|
+
description: 'Explain SQL queries or query results in plain language',
|
|
90
|
+
category: 'sub_agent',
|
|
91
|
+
inputSchema: {
|
|
92
|
+
type: 'object',
|
|
93
|
+
properties: {
|
|
94
|
+
question: {
|
|
95
|
+
type: 'string',
|
|
96
|
+
description: 'The original question that was asked',
|
|
97
|
+
},
|
|
98
|
+
generated_sql: {
|
|
99
|
+
type: 'string',
|
|
100
|
+
description: 'The SQL query to explain',
|
|
101
|
+
},
|
|
102
|
+
error_message: {
|
|
103
|
+
type: 'string',
|
|
104
|
+
description: 'Error message if the query failed',
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
required: ['question'],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'quarri_chart_agent',
|
|
112
|
+
description: 'Generate chart configuration from query results. Returns Plotly chart spec.',
|
|
113
|
+
category: 'sub_agent',
|
|
114
|
+
inputSchema: {
|
|
115
|
+
type: 'object',
|
|
116
|
+
properties: {
|
|
117
|
+
columns: {
|
|
118
|
+
type: 'array',
|
|
119
|
+
items: { type: 'string' },
|
|
120
|
+
description: 'Column names from query results',
|
|
121
|
+
},
|
|
122
|
+
rows: {
|
|
123
|
+
type: 'array',
|
|
124
|
+
items: { type: 'object' },
|
|
125
|
+
description: 'Data rows from query results',
|
|
126
|
+
},
|
|
127
|
+
question: {
|
|
128
|
+
type: 'string',
|
|
129
|
+
description: 'The original question for context',
|
|
130
|
+
},
|
|
131
|
+
sql_query: {
|
|
132
|
+
type: 'string',
|
|
133
|
+
description: 'The SQL query that produced the data',
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
required: ['columns', 'rows'],
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'quarri_metric_builder_agent',
|
|
141
|
+
description: 'Help define new metrics through a 3-step conversational process',
|
|
142
|
+
category: 'sub_agent',
|
|
143
|
+
inputSchema: {
|
|
144
|
+
type: 'object',
|
|
145
|
+
properties: {
|
|
146
|
+
message: {
|
|
147
|
+
type: 'string',
|
|
148
|
+
description: 'User message about metrics they want to define',
|
|
149
|
+
},
|
|
150
|
+
conversation_id: {
|
|
151
|
+
type: 'integer',
|
|
152
|
+
description: 'Conversation ID for multi-turn metric building',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
required: ['message'],
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: 'quarri_planning_agent',
|
|
160
|
+
description: 'Create detailed analysis plans for complex questions. Use for multi-step analysis.',
|
|
161
|
+
category: 'sub_agent',
|
|
162
|
+
inputSchema: {
|
|
163
|
+
type: 'object',
|
|
164
|
+
properties: {
|
|
165
|
+
analysis_request: {
|
|
166
|
+
type: 'string',
|
|
167
|
+
description: 'The analysis question or request',
|
|
168
|
+
},
|
|
169
|
+
mode: {
|
|
170
|
+
type: 'string',
|
|
171
|
+
enum: ['create', 'revise'],
|
|
172
|
+
description: 'Whether to create new plan or revise existing',
|
|
173
|
+
},
|
|
174
|
+
existing_plan: {
|
|
175
|
+
type: 'string',
|
|
176
|
+
description: 'Existing plan to revise (for revise mode)',
|
|
177
|
+
},
|
|
178
|
+
feedback: {
|
|
179
|
+
type: 'string',
|
|
180
|
+
description: 'User feedback for plan revision',
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
required: ['analysis_request'],
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: 'quarri_query_with_analysis',
|
|
188
|
+
description: `Run a complete analysis pipeline for a question:
|
|
189
|
+
1. Query Agent - generates SQL from the question
|
|
190
|
+
2. Execute SQL - runs the query and gets results
|
|
191
|
+
3. Stats Agent - performs statistical analysis, decides if chart is needed
|
|
192
|
+
4. Chart Agent - generates visualization (if recommended)
|
|
193
|
+
5. Insight Agent - generates key findings and recommendations
|
|
194
|
+
|
|
195
|
+
Use this tool for data questions that would benefit from full analysis.
|
|
196
|
+
Returns SQL, data, statistics, optional chart config, and insights.`,
|
|
197
|
+
category: 'sub_agent',
|
|
198
|
+
inputSchema: {
|
|
199
|
+
type: 'object',
|
|
200
|
+
properties: {
|
|
201
|
+
question: {
|
|
202
|
+
type: 'string',
|
|
203
|
+
description: 'The data question to analyze',
|
|
204
|
+
},
|
|
205
|
+
include_chart: {
|
|
206
|
+
type: 'boolean',
|
|
207
|
+
description: 'Whether to generate a chart (default: let stats agent decide)',
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
required: ['question'],
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: 'quarri_insight_agent',
|
|
215
|
+
description: 'Generate actionable insights from statistical analysis results',
|
|
216
|
+
category: 'sub_agent',
|
|
217
|
+
inputSchema: {
|
|
218
|
+
type: 'object',
|
|
219
|
+
properties: {
|
|
220
|
+
question: {
|
|
221
|
+
type: 'string',
|
|
222
|
+
description: 'The analysis question',
|
|
223
|
+
},
|
|
224
|
+
statistical_results: {
|
|
225
|
+
type: 'array',
|
|
226
|
+
items: { type: 'object' },
|
|
227
|
+
description: 'Results from stats_agent analysis',
|
|
228
|
+
},
|
|
229
|
+
sql_query: {
|
|
230
|
+
type: 'string',
|
|
231
|
+
description: 'The query that produced the data',
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
required: ['question', 'statistical_results'],
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: 'quarri_stats_agent',
|
|
239
|
+
description: 'Perform intelligent statistical analysis on query results',
|
|
240
|
+
category: 'sub_agent',
|
|
241
|
+
inputSchema: {
|
|
242
|
+
type: 'object',
|
|
243
|
+
properties: {
|
|
244
|
+
question: {
|
|
245
|
+
type: 'string',
|
|
246
|
+
description: 'The analysis question',
|
|
247
|
+
},
|
|
248
|
+
data: {
|
|
249
|
+
type: 'array',
|
|
250
|
+
items: { type: 'object' },
|
|
251
|
+
description: 'Data rows to analyze',
|
|
252
|
+
},
|
|
253
|
+
columns: {
|
|
254
|
+
type: 'array',
|
|
255
|
+
items: { type: 'string' },
|
|
256
|
+
description: 'Column names',
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
required: ['question', 'data', 'columns'],
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
name: 'quarri_staging_agent',
|
|
264
|
+
description: 'Propose staging transformations for raw tables (deduplication, PII handling, type casting)',
|
|
265
|
+
category: 'sub_agent',
|
|
266
|
+
inputSchema: {
|
|
267
|
+
type: 'object',
|
|
268
|
+
properties: {
|
|
269
|
+
table_name: {
|
|
270
|
+
type: 'string',
|
|
271
|
+
description: 'Source table name to stage',
|
|
272
|
+
},
|
|
273
|
+
schema_name: {
|
|
274
|
+
type: 'string',
|
|
275
|
+
description: 'Schema containing the table',
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
required: ['table_name'],
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
name: 'quarri_modeling_agent',
|
|
283
|
+
description: 'Plan silver layer data models (fact/dimension classification, relationships)',
|
|
284
|
+
category: 'sub_agent',
|
|
285
|
+
inputSchema: {
|
|
286
|
+
type: 'object',
|
|
287
|
+
properties: {
|
|
288
|
+
staging_tables: {
|
|
289
|
+
type: 'array',
|
|
290
|
+
items: { type: 'string' },
|
|
291
|
+
description: 'List of staging table names to model',
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
required: ['staging_tables'],
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: 'quarri_transformers_agent',
|
|
299
|
+
description: 'Generate SQL CREATE VIEW statements for dimensional model from a model plan',
|
|
300
|
+
category: 'sub_agent',
|
|
301
|
+
inputSchema: {
|
|
302
|
+
type: 'object',
|
|
303
|
+
properties: {
|
|
304
|
+
model_plan: {
|
|
305
|
+
type: 'object',
|
|
306
|
+
description: 'Model plan from modeling_agent with facts, dimensions, relationships',
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
required: ['model_plan'],
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
name: 'quarri_extraction_agent',
|
|
314
|
+
description: 'Generate dlt pipeline code for data extraction from APIs',
|
|
315
|
+
category: 'sub_agent',
|
|
316
|
+
inputSchema: {
|
|
317
|
+
type: 'object',
|
|
318
|
+
properties: {
|
|
319
|
+
source_name: {
|
|
320
|
+
type: 'string',
|
|
321
|
+
description: 'Data source name (e.g., "stripe", "hubspot")',
|
|
322
|
+
},
|
|
323
|
+
source_category: {
|
|
324
|
+
type: 'string',
|
|
325
|
+
description: 'Source category (e.g., "payments", "crm", "custom")',
|
|
326
|
+
},
|
|
327
|
+
selected_resources: {
|
|
328
|
+
type: 'array',
|
|
329
|
+
items: { type: 'string' },
|
|
330
|
+
description: 'List of tables/endpoints to extract',
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
required: ['source_name'],
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
// ==================== DATA TOOLS ====================
|
|
337
|
+
{
|
|
338
|
+
name: 'quarri_execute_sql',
|
|
339
|
+
description: 'Execute a SQL query against the database. Returns results as JSON.',
|
|
340
|
+
category: 'data',
|
|
341
|
+
inputSchema: {
|
|
342
|
+
type: 'object',
|
|
343
|
+
properties: {
|
|
344
|
+
sql: {
|
|
345
|
+
type: 'string',
|
|
346
|
+
description: 'SQL query to execute (SELECT only)',
|
|
347
|
+
},
|
|
348
|
+
limit: {
|
|
349
|
+
type: 'integer',
|
|
350
|
+
description: 'Maximum rows to return (default 100)',
|
|
351
|
+
default: 100,
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
required: ['sql'],
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
name: 'quarri_get_schema',
|
|
359
|
+
description: 'Get database schema information (tables, columns, types, relationships)',
|
|
360
|
+
category: 'data',
|
|
361
|
+
inputSchema: {
|
|
362
|
+
type: 'object',
|
|
363
|
+
properties: {
|
|
364
|
+
include_samples: {
|
|
365
|
+
type: 'boolean',
|
|
366
|
+
description: 'Include sample values for columns',
|
|
367
|
+
default: false,
|
|
368
|
+
},
|
|
369
|
+
table_filter: {
|
|
370
|
+
type: 'string',
|
|
371
|
+
description: 'Filter tables by pattern',
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
required: [],
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
name: 'quarri_search_values',
|
|
379
|
+
description: 'Search for values across database columns using semantic search',
|
|
380
|
+
category: 'data',
|
|
381
|
+
inputSchema: {
|
|
382
|
+
type: 'object',
|
|
383
|
+
properties: {
|
|
384
|
+
query: {
|
|
385
|
+
type: 'string',
|
|
386
|
+
description: 'Search query text',
|
|
387
|
+
},
|
|
388
|
+
column: {
|
|
389
|
+
type: 'string',
|
|
390
|
+
description: 'Specific column to search (optional)',
|
|
391
|
+
},
|
|
392
|
+
limit: {
|
|
393
|
+
type: 'integer',
|
|
394
|
+
description: 'Maximum results to return',
|
|
395
|
+
default: 10,
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
required: ['query'],
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
name: 'quarri_get_metrics',
|
|
403
|
+
description: 'Get list of all defined metrics',
|
|
404
|
+
category: 'data',
|
|
405
|
+
inputSchema: {
|
|
406
|
+
type: 'object',
|
|
407
|
+
properties: {
|
|
408
|
+
status: {
|
|
409
|
+
type: 'string',
|
|
410
|
+
enum: ['approved', 'pending', 'all'],
|
|
411
|
+
description: 'Filter by approval status',
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
required: [],
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
name: 'quarri_create_metric',
|
|
419
|
+
description: 'Create a new metric definition',
|
|
420
|
+
category: 'data',
|
|
421
|
+
inputSchema: {
|
|
422
|
+
type: 'object',
|
|
423
|
+
properties: {
|
|
424
|
+
name: {
|
|
425
|
+
type: 'string',
|
|
426
|
+
description: 'Metric name',
|
|
427
|
+
},
|
|
428
|
+
description: {
|
|
429
|
+
type: 'string',
|
|
430
|
+
description: 'Metric description',
|
|
431
|
+
},
|
|
432
|
+
sql_template: {
|
|
433
|
+
type: 'string',
|
|
434
|
+
description: 'SQL template for the metric',
|
|
435
|
+
},
|
|
436
|
+
dimensions: {
|
|
437
|
+
type: 'array',
|
|
438
|
+
items: { type: 'string' },
|
|
439
|
+
description: 'Available dimensions for grouping',
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
required: ['name', 'description', 'sql_template'],
|
|
443
|
+
},
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
name: 'quarri_approve_metric',
|
|
447
|
+
description: 'Approve a pending metric definition',
|
|
448
|
+
category: 'data',
|
|
449
|
+
inputSchema: {
|
|
450
|
+
type: 'object',
|
|
451
|
+
properties: {
|
|
452
|
+
metric_id: {
|
|
453
|
+
type: 'integer',
|
|
454
|
+
description: 'ID of the metric to approve',
|
|
455
|
+
},
|
|
456
|
+
},
|
|
457
|
+
required: ['metric_id'],
|
|
458
|
+
},
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
name: 'quarri_get_metric_detail',
|
|
462
|
+
description: 'Get detailed information about a specific metric',
|
|
463
|
+
category: 'data',
|
|
464
|
+
inputSchema: {
|
|
465
|
+
type: 'object',
|
|
466
|
+
properties: {
|
|
467
|
+
metric_id: {
|
|
468
|
+
type: 'integer',
|
|
469
|
+
description: 'ID of the metric',
|
|
470
|
+
},
|
|
471
|
+
},
|
|
472
|
+
required: ['metric_id'],
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
name: 'quarri_search_metrics',
|
|
477
|
+
description: 'Search metrics by name or description',
|
|
478
|
+
category: 'data',
|
|
479
|
+
inputSchema: {
|
|
480
|
+
type: 'object',
|
|
481
|
+
properties: {
|
|
482
|
+
query: {
|
|
483
|
+
type: 'string',
|
|
484
|
+
description: 'Search query',
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
required: ['query'],
|
|
488
|
+
},
|
|
489
|
+
},
|
|
490
|
+
// ==================== CONFIGURATION TOOLS ====================
|
|
491
|
+
{
|
|
492
|
+
name: 'quarri_list_agent_prompts',
|
|
493
|
+
description: 'List all agent prompts/system messages',
|
|
494
|
+
category: 'configuration',
|
|
495
|
+
inputSchema: {
|
|
496
|
+
type: 'object',
|
|
497
|
+
properties: {},
|
|
498
|
+
required: [],
|
|
499
|
+
},
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
name: 'quarri_update_agent_prompt',
|
|
503
|
+
description: 'Update an agent prompt/system message',
|
|
504
|
+
category: 'configuration',
|
|
505
|
+
inputSchema: {
|
|
506
|
+
type: 'object',
|
|
507
|
+
properties: {
|
|
508
|
+
agent_name: {
|
|
509
|
+
type: 'string',
|
|
510
|
+
description: 'Name of the agent to update',
|
|
511
|
+
},
|
|
512
|
+
prompt: {
|
|
513
|
+
type: 'string',
|
|
514
|
+
description: 'New prompt text',
|
|
515
|
+
},
|
|
516
|
+
},
|
|
517
|
+
required: ['agent_name', 'prompt'],
|
|
518
|
+
},
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
name: 'quarri_list_rules',
|
|
522
|
+
description: 'List all agent rules for query generation',
|
|
523
|
+
category: 'configuration',
|
|
524
|
+
inputSchema: {
|
|
525
|
+
type: 'object',
|
|
526
|
+
properties: {},
|
|
527
|
+
required: [],
|
|
528
|
+
},
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
name: 'quarri_create_rule',
|
|
532
|
+
description: 'Create a new rule for query generation',
|
|
533
|
+
category: 'configuration',
|
|
534
|
+
inputSchema: {
|
|
535
|
+
type: 'object',
|
|
536
|
+
properties: {
|
|
537
|
+
rule_text: {
|
|
538
|
+
type: 'string',
|
|
539
|
+
description: 'The rule text',
|
|
540
|
+
},
|
|
541
|
+
category: {
|
|
542
|
+
type: 'string',
|
|
543
|
+
description: 'Rule category (e.g., "naming", "joins", "filters")',
|
|
544
|
+
},
|
|
545
|
+
},
|
|
546
|
+
required: ['rule_text'],
|
|
547
|
+
},
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
name: 'quarri_update_rule',
|
|
551
|
+
description: 'Update an existing rule',
|
|
552
|
+
category: 'configuration',
|
|
553
|
+
inputSchema: {
|
|
554
|
+
type: 'object',
|
|
555
|
+
properties: {
|
|
556
|
+
rule_id: {
|
|
557
|
+
type: 'integer',
|
|
558
|
+
description: 'ID of the rule to update',
|
|
559
|
+
},
|
|
560
|
+
rule_text: {
|
|
561
|
+
type: 'string',
|
|
562
|
+
description: 'New rule text',
|
|
563
|
+
},
|
|
564
|
+
category: {
|
|
565
|
+
type: 'string',
|
|
566
|
+
description: 'New rule category',
|
|
567
|
+
},
|
|
568
|
+
},
|
|
569
|
+
required: ['rule_id', 'rule_text'],
|
|
570
|
+
},
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
name: 'quarri_delete_rule',
|
|
574
|
+
description: 'Delete a rule',
|
|
575
|
+
category: 'configuration',
|
|
576
|
+
inputSchema: {
|
|
577
|
+
type: 'object',
|
|
578
|
+
properties: {
|
|
579
|
+
rule_id: {
|
|
580
|
+
type: 'integer',
|
|
581
|
+
description: 'ID of the rule to delete',
|
|
582
|
+
},
|
|
583
|
+
},
|
|
584
|
+
required: ['rule_id'],
|
|
585
|
+
},
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
name: 'quarri_vectorize_column_values',
|
|
589
|
+
description: 'Enable semantic search on a column by vectorizing its values',
|
|
590
|
+
category: 'configuration',
|
|
591
|
+
inputSchema: {
|
|
592
|
+
type: 'object',
|
|
593
|
+
properties: {
|
|
594
|
+
table_name: {
|
|
595
|
+
type: 'string',
|
|
596
|
+
description: 'Table containing the column',
|
|
597
|
+
},
|
|
598
|
+
column_name: {
|
|
599
|
+
type: 'string',
|
|
600
|
+
description: 'Column to vectorize',
|
|
601
|
+
},
|
|
602
|
+
},
|
|
603
|
+
required: ['table_name', 'column_name'],
|
|
604
|
+
},
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
name: 'quarri_list_searchable_columns',
|
|
608
|
+
description: 'List columns that have been vectorized for semantic search',
|
|
609
|
+
category: 'configuration',
|
|
610
|
+
inputSchema: {
|
|
611
|
+
type: 'object',
|
|
612
|
+
properties: {},
|
|
613
|
+
required: [],
|
|
614
|
+
},
|
|
615
|
+
},
|
|
616
|
+
// ==================== CANVAS TOOLS ====================
|
|
617
|
+
{
|
|
618
|
+
name: 'quarri_list_canvases',
|
|
619
|
+
description: 'List all canvas workspaces',
|
|
620
|
+
category: 'canvas',
|
|
621
|
+
inputSchema: {
|
|
622
|
+
type: 'object',
|
|
623
|
+
properties: {},
|
|
624
|
+
required: [],
|
|
625
|
+
},
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
name: 'quarri_get_canvas',
|
|
629
|
+
description: 'Get a specific canvas with all its panels',
|
|
630
|
+
category: 'canvas',
|
|
631
|
+
inputSchema: {
|
|
632
|
+
type: 'object',
|
|
633
|
+
properties: {
|
|
634
|
+
canvas_id: {
|
|
635
|
+
type: 'integer',
|
|
636
|
+
description: 'ID of the canvas',
|
|
637
|
+
},
|
|
638
|
+
},
|
|
639
|
+
required: ['canvas_id'],
|
|
640
|
+
},
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
name: 'quarri_create_chart_panel',
|
|
644
|
+
description: 'Create a new chart panel on a canvas',
|
|
645
|
+
category: 'canvas',
|
|
646
|
+
inputSchema: {
|
|
647
|
+
type: 'object',
|
|
648
|
+
properties: {
|
|
649
|
+
canvas_id: {
|
|
650
|
+
type: 'integer',
|
|
651
|
+
description: 'ID of the canvas',
|
|
652
|
+
},
|
|
653
|
+
title: {
|
|
654
|
+
type: 'string',
|
|
655
|
+
description: 'Panel title',
|
|
656
|
+
},
|
|
657
|
+
sql_query: {
|
|
658
|
+
type: 'string',
|
|
659
|
+
description: 'SQL query for the chart data',
|
|
660
|
+
},
|
|
661
|
+
chart_config: {
|
|
662
|
+
type: 'object',
|
|
663
|
+
description: 'Plotly chart configuration',
|
|
664
|
+
},
|
|
665
|
+
},
|
|
666
|
+
required: ['canvas_id', 'title', 'sql_query', 'chart_config'],
|
|
667
|
+
},
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
name: 'quarri_update_chart_panel',
|
|
671
|
+
description: 'Update an existing chart panel',
|
|
672
|
+
category: 'canvas',
|
|
673
|
+
inputSchema: {
|
|
674
|
+
type: 'object',
|
|
675
|
+
properties: {
|
|
676
|
+
panel_id: {
|
|
677
|
+
type: 'integer',
|
|
678
|
+
description: 'ID of the panel to update',
|
|
679
|
+
},
|
|
680
|
+
title: {
|
|
681
|
+
type: 'string',
|
|
682
|
+
description: 'New panel title',
|
|
683
|
+
},
|
|
684
|
+
sql_query: {
|
|
685
|
+
type: 'string',
|
|
686
|
+
description: 'New SQL query',
|
|
687
|
+
},
|
|
688
|
+
chart_config: {
|
|
689
|
+
type: 'object',
|
|
690
|
+
description: 'New chart configuration',
|
|
691
|
+
},
|
|
692
|
+
},
|
|
693
|
+
required: ['panel_id'],
|
|
694
|
+
},
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
name: 'quarri_export_canvas',
|
|
698
|
+
description: 'Export a canvas to PDF or image',
|
|
699
|
+
category: 'canvas',
|
|
700
|
+
inputSchema: {
|
|
701
|
+
type: 'object',
|
|
702
|
+
properties: {
|
|
703
|
+
canvas_id: {
|
|
704
|
+
type: 'integer',
|
|
705
|
+
description: 'ID of the canvas to export',
|
|
706
|
+
},
|
|
707
|
+
format: {
|
|
708
|
+
type: 'string',
|
|
709
|
+
enum: ['pdf', 'png'],
|
|
710
|
+
description: 'Export format',
|
|
711
|
+
},
|
|
712
|
+
},
|
|
713
|
+
required: ['canvas_id', 'format'],
|
|
714
|
+
},
|
|
715
|
+
},
|
|
716
|
+
// ==================== TEAM TOOLS ====================
|
|
717
|
+
{
|
|
718
|
+
name: 'quarri_list_teams',
|
|
719
|
+
description: 'List all teams in the organization',
|
|
720
|
+
category: 'team',
|
|
721
|
+
inputSchema: {
|
|
722
|
+
type: 'object',
|
|
723
|
+
properties: {},
|
|
724
|
+
required: [],
|
|
725
|
+
},
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
name: 'quarri_get_team_filters',
|
|
729
|
+
description: 'Get row-level filters applied to a team',
|
|
730
|
+
category: 'team',
|
|
731
|
+
inputSchema: {
|
|
732
|
+
type: 'object',
|
|
733
|
+
properties: {
|
|
734
|
+
team_id: {
|
|
735
|
+
type: 'integer',
|
|
736
|
+
description: 'ID of the team',
|
|
737
|
+
},
|
|
738
|
+
},
|
|
739
|
+
required: ['team_id'],
|
|
740
|
+
},
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
name: 'quarri_get_team_restrictions',
|
|
744
|
+
description: 'Get column-level restrictions for a team',
|
|
745
|
+
category: 'team',
|
|
746
|
+
inputSchema: {
|
|
747
|
+
type: 'object',
|
|
748
|
+
properties: {
|
|
749
|
+
team_id: {
|
|
750
|
+
type: 'integer',
|
|
751
|
+
description: 'ID of the team',
|
|
752
|
+
},
|
|
753
|
+
},
|
|
754
|
+
required: ['team_id'],
|
|
755
|
+
},
|
|
756
|
+
},
|
|
757
|
+
// ==================== EXTRACTION TOOLS ====================
|
|
758
|
+
{
|
|
759
|
+
name: 'quarri_list_extraction_sources',
|
|
760
|
+
description: 'List available data extraction sources',
|
|
761
|
+
category: 'extraction',
|
|
762
|
+
inputSchema: {
|
|
763
|
+
type: 'object',
|
|
764
|
+
properties: {},
|
|
765
|
+
required: [],
|
|
766
|
+
},
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
name: 'quarri_configure_extraction',
|
|
770
|
+
description: 'Configure a data extraction source',
|
|
771
|
+
category: 'extraction',
|
|
772
|
+
inputSchema: {
|
|
773
|
+
type: 'object',
|
|
774
|
+
properties: {
|
|
775
|
+
source_name: {
|
|
776
|
+
type: 'string',
|
|
777
|
+
description: 'Name of the data source',
|
|
778
|
+
},
|
|
779
|
+
credentials: {
|
|
780
|
+
type: 'object',
|
|
781
|
+
description: 'Credentials for the source',
|
|
782
|
+
},
|
|
783
|
+
resources: {
|
|
784
|
+
type: 'array',
|
|
785
|
+
items: { type: 'string' },
|
|
786
|
+
description: 'Resources/tables to extract',
|
|
787
|
+
},
|
|
788
|
+
},
|
|
789
|
+
required: ['source_name'],
|
|
790
|
+
},
|
|
791
|
+
},
|
|
792
|
+
{
|
|
793
|
+
name: 'quarri_discover_tables',
|
|
794
|
+
description: 'Discover available tables in a data source',
|
|
795
|
+
category: 'extraction',
|
|
796
|
+
inputSchema: {
|
|
797
|
+
type: 'object',
|
|
798
|
+
properties: {
|
|
799
|
+
source_name: {
|
|
800
|
+
type: 'string',
|
|
801
|
+
description: 'Name of the data source',
|
|
802
|
+
},
|
|
803
|
+
},
|
|
804
|
+
required: ['source_name'],
|
|
805
|
+
},
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
name: 'quarri_propose_transformation',
|
|
809
|
+
description: 'Propose a data transformation for extracted data',
|
|
810
|
+
category: 'extraction',
|
|
811
|
+
inputSchema: {
|
|
812
|
+
type: 'object',
|
|
813
|
+
properties: {
|
|
814
|
+
table_name: {
|
|
815
|
+
type: 'string',
|
|
816
|
+
description: 'Table to transform',
|
|
817
|
+
},
|
|
818
|
+
transformation_type: {
|
|
819
|
+
type: 'string',
|
|
820
|
+
description: 'Type of transformation',
|
|
821
|
+
},
|
|
822
|
+
},
|
|
823
|
+
required: ['table_name'],
|
|
824
|
+
},
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
name: 'quarri_upload_csv',
|
|
828
|
+
description: 'Upload a CSV file to the database',
|
|
829
|
+
category: 'extraction',
|
|
830
|
+
inputSchema: {
|
|
831
|
+
type: 'object',
|
|
832
|
+
properties: {
|
|
833
|
+
file_path: {
|
|
834
|
+
type: 'string',
|
|
835
|
+
description: 'Path to the CSV file',
|
|
836
|
+
},
|
|
837
|
+
table_name: {
|
|
838
|
+
type: 'string',
|
|
839
|
+
description: 'Target table name',
|
|
840
|
+
},
|
|
841
|
+
},
|
|
842
|
+
required: ['file_path', 'table_name'],
|
|
843
|
+
},
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
name: 'quarri_generate_quarri_schema',
|
|
847
|
+
description: 'Generate Quarri schema configuration from database tables',
|
|
848
|
+
category: 'extraction',
|
|
849
|
+
inputSchema: {
|
|
850
|
+
type: 'object',
|
|
851
|
+
properties: {
|
|
852
|
+
tables: {
|
|
853
|
+
type: 'array',
|
|
854
|
+
items: { type: 'string' },
|
|
855
|
+
description: 'List of table names to include',
|
|
856
|
+
},
|
|
857
|
+
},
|
|
858
|
+
required: [],
|
|
859
|
+
},
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
name: 'quarri_list_raw_tables',
|
|
863
|
+
description: 'List raw/unprocessed tables in the database',
|
|
864
|
+
category: 'extraction',
|
|
865
|
+
inputSchema: {
|
|
866
|
+
type: 'object',
|
|
867
|
+
properties: {},
|
|
868
|
+
required: [],
|
|
869
|
+
},
|
|
870
|
+
},
|
|
871
|
+
// ==================== DEBUG TOOLS ====================
|
|
872
|
+
{
|
|
873
|
+
name: 'quarri_read_server_logs',
|
|
874
|
+
description: 'Read recent server logs for debugging',
|
|
875
|
+
category: 'debug',
|
|
876
|
+
inputSchema: {
|
|
877
|
+
type: 'object',
|
|
878
|
+
properties: {
|
|
879
|
+
lines: {
|
|
880
|
+
type: 'integer',
|
|
881
|
+
description: 'Number of log lines to read',
|
|
882
|
+
default: 100,
|
|
883
|
+
},
|
|
884
|
+
level: {
|
|
885
|
+
type: 'string',
|
|
886
|
+
enum: ['debug', 'info', 'warning', 'error'],
|
|
887
|
+
description: 'Minimum log level to show',
|
|
888
|
+
},
|
|
889
|
+
},
|
|
890
|
+
required: [],
|
|
891
|
+
},
|
|
892
|
+
},
|
|
893
|
+
{
|
|
894
|
+
name: 'quarri_query_repl_activity',
|
|
895
|
+
description: 'Query REPL agent activity history',
|
|
896
|
+
category: 'debug',
|
|
897
|
+
inputSchema: {
|
|
898
|
+
type: 'object',
|
|
899
|
+
properties: {
|
|
900
|
+
session_id: {
|
|
901
|
+
type: 'string',
|
|
902
|
+
description: 'Filter by session ID',
|
|
903
|
+
},
|
|
904
|
+
limit: {
|
|
905
|
+
type: 'integer',
|
|
906
|
+
description: 'Maximum records to return',
|
|
907
|
+
default: 50,
|
|
908
|
+
},
|
|
909
|
+
},
|
|
910
|
+
required: [],
|
|
911
|
+
},
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
name: 'quarri_read_fly_logs',
|
|
915
|
+
description: 'Read production logs from Fly.io',
|
|
916
|
+
category: 'debug',
|
|
917
|
+
inputSchema: {
|
|
918
|
+
type: 'object',
|
|
919
|
+
properties: {
|
|
920
|
+
lines: {
|
|
921
|
+
type: 'integer',
|
|
922
|
+
description: 'Number of log lines to read',
|
|
923
|
+
default: 100,
|
|
924
|
+
},
|
|
925
|
+
},
|
|
926
|
+
required: [],
|
|
927
|
+
},
|
|
928
|
+
},
|
|
929
|
+
// ==================== SESSION TOOLS (new for MCP) ====================
|
|
930
|
+
{
|
|
931
|
+
name: 'quarri_list_databases',
|
|
932
|
+
description: 'List all databases the authenticated user has access to',
|
|
933
|
+
category: 'session',
|
|
934
|
+
inputSchema: {
|
|
935
|
+
type: 'object',
|
|
936
|
+
properties: {},
|
|
937
|
+
required: [],
|
|
938
|
+
},
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
name: 'quarri_select_database',
|
|
942
|
+
description: 'Select the active database for subsequent queries',
|
|
943
|
+
category: 'session',
|
|
944
|
+
inputSchema: {
|
|
945
|
+
type: 'object',
|
|
946
|
+
properties: {
|
|
947
|
+
database_name: {
|
|
948
|
+
type: 'string',
|
|
949
|
+
description: 'Name of the database to select',
|
|
950
|
+
},
|
|
951
|
+
},
|
|
952
|
+
required: ['database_name'],
|
|
953
|
+
},
|
|
954
|
+
},
|
|
955
|
+
];
|
|
956
|
+
/**
|
|
957
|
+
* Get backend tool name from MCP tool name
|
|
958
|
+
*/
|
|
959
|
+
function getBackendToolName(mcpToolName) {
|
|
960
|
+
return exports.TOOL_NAME_MAP[mcpToolName] ?? null;
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* Get tool definition by name
|
|
964
|
+
*/
|
|
965
|
+
function getToolDefinition(name) {
|
|
966
|
+
return exports.TOOL_DEFINITIONS.find((t) => t.name === name);
|
|
967
|
+
}
|
|
968
|
+
//# sourceMappingURL=definitions.js.map
|