You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
).optional().describe('Precise filters on specific columns. This applies to each row individually. Each filter key must be: column_key + suffix. Available suffixes: _eq (strictly equal, case-sensitive), _in (value must be in the list, case-sensitive, values separated by a comma), _search (full-text search within that column, case-insensitive and flexible matching), _gte (greater than or equal), _gt (greater than), _lte (less than or equal), _lt (less than), _exists (exists), and _nexists (does not exist). Use column keys from describe_dataset. Example: { "nom_search": "Jean", "age_lte": "30", "ville_eq": "Paris", "code_in": "A,B,C" } searches for people whose names contain "Jean", who are 30 years old or younger, who live in Paris, and whose code is A, B, or C.')
214
+
207
215
/**
208
216
* Tool to search for specific data rows within a dataset using either full-text search OR precise filters.
datasetId: z.string().describe('The unique dataset ID obtained from search_datasets or provided by the user'),
226
234
query: z.string().optional().describe('French keywords for full-text search across all dataset columns (simple keywords, not sentences). Do not use with filters parameter. Examples: "Jean Dupont", "Paris", "2025"'),
.describe('Precise filters on specific columns. This applies to each row individually. Each filter key must be: column_key + suffix. Available suffixes: _eq (strictly equal, case-sensitive), _in (value must be in the list, case-sensitive, values separated by a comma), _search (full-text search within that column, case-insensitive and flexible matching), _gte (greater than or equal), _gt (greater than), _lte (less than or equal), _lt (less than), _exists (exists), and _nexists (does not exist). Use column keys from describe_dataset. Example: { "nom_search": "Jean", "age_lte": "30", "ville_eq": "Paris", "code_in": "A,B,C" } searches for people whose names contain "Jean", who are 30 years old or younger, who live in Paris, and whose code is A, B, or C.'),
235
+
filters: filtersSchema,
235
236
select: z.string().optional().describe('Optional comma-separated list of column keys to include in the results. Useful when the dataset has many columns to reduce output size. If not provided, all columns are returned. Use column keys from describe_dataset. Format: column1,column2,column3 (No spaces after commas). Example: "nom,age,ville"')
description: 'Perform aggregations on dataset columns, such as counting unique values, summing numeric columns, or calculating averages. Use this after describe_dataset to understand the dataset structure and available column keys. Example: {"datasetId": "123", "aggregationColumn": ["code_sexe", "region"], "aggregation": {"column": "age", "metric": "avg"}} this will return the average age grouped by code_sexe and region. Aggregation is limited to a maximum of 3 columns.',
329
+
description: 'Perform aggregations on dataset columns, such as counting unique values, summing numeric columns, or calculating averages. Use this after describe_dataset to understand the dataset structure and available column keys. Example: {"datasetId": "123", "aggregationColumns": ["code_sexe", "region"], "aggregation": {"column": "age", "metric": "avg"}} this will return the average age grouped by code_sexe and region. Aggregation is limited to a maximum of 3 columns.',
329
330
inputSchema: {
330
331
datasetId: z.string().describe('The unique dataset ID obtained from search_datasets tool'),
331
-
aggregationColumn: z.array(z.string())
332
+
aggregationColumns: z.array(z.string())
333
+
.min(1,'You must specify at least one column to aggregate')
332
334
.max(3,'You can aggregate by at most 3 columns')
333
-
.describe('List of column keys to aggregate (use keys from describe_dataset, max 3 columns)'),
335
+
.describe('List of column keys to aggregate (use keys from describe_dataset, min 1 column, max 3 columns)'),
334
336
aggregation: z.object({
335
337
column: z.string().describe('The column key to aggregate (use keys from describe_dataset)'),
336
-
metric: z.enum(['sum','avg','min','max']).describe('Aggregation metric to perform on the column')
338
+
metric: z.enum(['sum','avg','min','max','count']).describe('Aggregation metric to perform on the column. Available operations are: sum, avg, min, max, count.')
337
339
})
338
340
.optional()
339
-
.describe('The aggregation specification to perform on the specified column. Use keys from describe_dataset. If not provided, defaults to counting unique values in the specified column.'),
.describe('Precise filters on specific columns. This applies to each row individually. Each filter key must be: column_key + suffix. Available suffixes: _eq (strictly equal, case-sensitive), _in (value must be in the list, case-sensitive, values separated by a comma), _search (full-text search within that column, case-insensitive and flexible matching), _gte (greater than or equal), _gt (greater than), _lte (less than or equal), _lt (less than), _exists (exists), and _nexists (does not exist). Use column keys from describe_dataset. Example: { "nom_search": "Jean", "age_lte": "30", "ville_eq": "Paris", "code_in": "A,B,C" } searches for people whose names contain "Jean", who are 30 years old or younger, who live in Paris, and whose code is A, B, or C.'),
341
+
.describe('The aggregation specification to perform on the specified column. Use keys from describe_dataset. If not provided, defaults to counting unique values in the aggregation column.'),
342
+
filters: filtersSchema
348
343
},
349
344
outputSchema: {
350
345
total: z.number().describe('The total number of rows in the dataset'),
debug('Executing aggregate_data tool with dataset:',params.datasetId,'columns:',params.aggregationColumns,'aggregation:',JSON.stringify(params.aggregation))
363
358
364
-
// Limit aggregationColumn to 3 elements max (runtime check for extra safety)
365
-
if(params.aggregationColumn.length>3){
359
+
// Limit aggregationColumns to 3 elements max
360
+
if(params.aggregationColumns.length>3){
366
361
thrownewError('You can aggregate by at most 3 columns')
0 commit comments