mcp-meilisearch 1.4.25 → 1.4.26

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.
@@ -13,9 +13,13 @@ import { createErrorResponse } from "../../utils/error-handler.js";
13
13
  */
14
14
  export const registerSettingsTools = (server) => {
15
15
  // Get all settings for an index
16
- server.tool("get-settings", "Get all settings for a Meilisearch index", {
17
- indexUid: z.string().describe("Unique identifier of the index"),
18
- }, { category: "meilisearch" }, async ({ indexUid }) => {
16
+ server.registerTool("get-settings", {
17
+ description: "Get all settings for a Meilisearch index",
18
+ inputSchema: {
19
+ indexUid: z.string().describe("Unique identifier of the index"),
20
+ },
21
+ _meta: { category: "meilisearch" },
22
+ }, async ({ indexUid }) => {
19
23
  try {
20
24
  const response = await apiClient.get(`/indexes/${indexUid}/settings`);
21
25
  return {
@@ -28,17 +32,18 @@ export const registerSettingsTools = (server) => {
28
32
  return createErrorResponse(error);
29
33
  }
30
34
  });
31
- // Update all settings for an index
32
- server.tool("update-settings", "Update all settings for a Meilisearch index", {
33
- indexUid: z.string().describe("Unique identifier of the index"),
34
- settings: z
35
- .string()
36
- .describe("JSON object containing settings to update"),
37
- }, { category: "meilisearch" }, async ({ indexUid, settings }) => {
35
+ server.registerTool("update-settings", {
36
+ description: "Update all settings for a Meilisearch index",
37
+ inputSchema: {
38
+ indexUid: z.string().describe("Unique identifier of the index"),
39
+ settings: z
40
+ .string()
41
+ .describe("JSON object containing settings to update"),
42
+ },
43
+ _meta: { category: "meilisearch" },
44
+ }, async ({ indexUid, settings }) => {
38
45
  try {
39
- // Parse the settings string to ensure it's valid JSON
40
46
  const parsedSettings = JSON.parse(settings);
41
- // Ensure settings is an object
42
47
  if (typeof parsedSettings !== "object" ||
43
48
  parsedSettings === null ||
44
49
  Array.isArray(parsedSettings)) {
@@ -58,10 +63,13 @@ export const registerSettingsTools = (server) => {
58
63
  return createErrorResponse(error);
59
64
  }
60
65
  });
61
- // Reset all settings for an index
62
- server.tool("reset-settings", "Reset all settings for a Meilisearch index to their default values", {
63
- indexUid: z.string().describe("Unique identifier of the index"),
64
- }, { category: "meilisearch" }, async ({ indexUid }) => {
66
+ server.registerTool("reset-settings", {
67
+ description: "Reset all settings for a Meilisearch index to their default values",
68
+ inputSchema: {
69
+ indexUid: z.string().describe("Unique identifier of the index"),
70
+ },
71
+ _meta: { category: "meilisearch" },
72
+ }, async ({ indexUid }) => {
65
73
  try {
66
74
  const response = await apiClient.delete(`/indexes/${indexUid}/settings`);
67
75
  return {
@@ -74,10 +82,13 @@ export const registerSettingsTools = (server) => {
74
82
  return createErrorResponse(error);
75
83
  }
76
84
  });
77
- // Get displayed attributes setting
78
- server.tool("get-displayed-attributes", "Get the displayed attributes setting for a Meilisearch index", {
79
- indexUid: z.string().describe("Unique identifier of the index"),
80
- }, { category: "meilisearch" }, async ({ indexUid }) => {
85
+ server.registerTool("get-displayed-attributes", {
86
+ description: "Get the displayed attributes setting for a Meilisearch index",
87
+ inputSchema: {
88
+ indexUid: z.string().describe("Unique identifier of the index"),
89
+ },
90
+ _meta: { category: "meilisearch" },
91
+ }, async ({ indexUid }) => {
81
92
  try {
82
93
  const response = await apiClient.get(`/indexes/${indexUid}/settings/displayed-attributes`);
83
94
  return {
@@ -90,13 +101,16 @@ export const registerSettingsTools = (server) => {
90
101
  return createErrorResponse(error);
91
102
  }
92
103
  });
93
- // Update displayed attributes setting
94
- server.tool("update-displayed-attributes", "Update the displayed attributes setting for a Meilisearch index", {
95
- indexUid: z.string().describe("Unique identifier of the index"),
96
- displayedAttributes: z
97
- .string()
98
- .describe('JSON array of attributes to display, e.g. ["title", "description"]'),
99
- }, { category: "meilisearch" }, async ({ indexUid, displayedAttributes }) => {
104
+ server.registerTool("update-displayed-attributes", {
105
+ description: "Update the displayed attributes setting for a Meilisearch index",
106
+ inputSchema: {
107
+ indexUid: z.string().describe("Unique identifier of the index"),
108
+ displayedAttributes: z
109
+ .string()
110
+ .describe('JSON array of attributes to display, e.g. ["title", "description"]'),
111
+ },
112
+ _meta: { category: "meilisearch" },
113
+ }, async ({ indexUid, displayedAttributes }) => {
100
114
  try {
101
115
  const response = await apiClient.put(`/indexes/${indexUid}/settings/displayed-attributes`, displayedAttributes);
102
116
  return {
@@ -109,10 +123,13 @@ export const registerSettingsTools = (server) => {
109
123
  return createErrorResponse(error);
110
124
  }
111
125
  });
112
- // Reset displayed attributes setting
113
- server.tool("reset-displayed-attributes", "Reset the displayed attributes setting for a Meilisearch index", {
114
- indexUid: z.string().describe("Unique identifier of the index"),
115
- }, { category: "meilisearch" }, async ({ indexUid }) => {
126
+ server.registerTool("reset-displayed-attributes", {
127
+ description: "Reset the displayed attributes setting for a Meilisearch index",
128
+ inputSchema: {
129
+ indexUid: z.string().describe("Unique identifier of the index"),
130
+ },
131
+ _meta: { category: "meilisearch" },
132
+ }, async ({ indexUid }) => {
116
133
  try {
117
134
  const response = await apiClient.delete(`/indexes/${indexUid}/settings/displayed-attributes`);
118
135
  return {
@@ -125,10 +142,13 @@ export const registerSettingsTools = (server) => {
125
142
  return createErrorResponse(error);
126
143
  }
127
144
  });
128
- // Get filterable attributes setting
129
- server.tool("get-filterable-attributes", "Get the filterable attributes setting for a Meilisearch index", {
130
- indexUid: z.string().describe("Unique identifier of the index"),
131
- }, { category: "meilisearch" }, async ({ indexUid }) => {
145
+ server.registerTool("get-filterable-attributes", {
146
+ description: "Get the filterable attributes setting for a Meilisearch index",
147
+ inputSchema: {
148
+ indexUid: z.string().describe("Unique identifier of the index"),
149
+ },
150
+ _meta: { category: "meilisearch" },
151
+ }, async ({ indexUid }) => {
132
152
  try {
133
153
  const response = await apiClient.get(`/indexes/${indexUid}/settings/filterable-attributes`);
134
154
  return {
@@ -141,13 +161,16 @@ export const registerSettingsTools = (server) => {
141
161
  return createErrorResponse(error);
142
162
  }
143
163
  });
144
- // Update filterable attributes setting
145
- server.tool("update-filterable-attributes", "Update the filterable attributes setting for a Meilisearch index", {
146
- indexUid: z.string().describe("Unique identifier of the index"),
147
- filterableAttributes: z
148
- .string()
149
- .describe('JSON array of attributes that can be used as filters, e.g. ["genre", "director"]'),
150
- }, { category: "meilisearch" }, async ({ indexUid, filterableAttributes }) => {
164
+ server.registerTool("update-filterable-attributes", {
165
+ description: "Update the filterable attributes setting for a Meilisearch index",
166
+ inputSchema: {
167
+ indexUid: z.string().describe("Unique identifier of the index"),
168
+ filterableAttributes: z
169
+ .string()
170
+ .describe('JSON array of attributes that can be used as filters, e.g. ["genre", "director"]'),
171
+ },
172
+ _meta: { category: "meilisearch" },
173
+ }, async ({ indexUid, filterableAttributes }) => {
151
174
  try {
152
175
  const response = await apiClient.put(`/indexes/${indexUid}/settings/filterable-attributes`, filterableAttributes);
153
176
  return {
@@ -160,10 +183,13 @@ export const registerSettingsTools = (server) => {
160
183
  return createErrorResponse(error);
161
184
  }
162
185
  });
163
- // Reset filterable attributes setting
164
- server.tool("reset-filterable-attributes", "Reset the filterable attributes setting for a Meilisearch index", {
165
- indexUid: z.string().describe("Unique identifier of the index"),
166
- }, { category: "meilisearch" }, async ({ indexUid }) => {
186
+ server.registerTool("reset-filterable-attributes", {
187
+ description: "Reset the filterable attributes setting for a Meilisearch index",
188
+ inputSchema: {
189
+ indexUid: z.string().describe("Unique identifier of the index"),
190
+ },
191
+ _meta: { category: "meilisearch" },
192
+ }, async ({ indexUid }) => {
167
193
  try {
168
194
  const response = await apiClient.delete(`/indexes/${indexUid}/settings/filterable-attributes`);
169
195
  return {
@@ -176,10 +202,13 @@ export const registerSettingsTools = (server) => {
176
202
  return createErrorResponse(error);
177
203
  }
178
204
  });
179
- // Get sortable attributes setting
180
- server.tool("get-sortable-attributes", "Get the sortable attributes setting for a Meilisearch index", {
181
- indexUid: z.string().describe("Unique identifier of the index"),
182
- }, { category: "meilisearch" }, async ({ indexUid }) => {
205
+ server.registerTool("get-sortable-attributes", {
206
+ description: "Get the sortable attributes setting for a Meilisearch index",
207
+ inputSchema: {
208
+ indexUid: z.string().describe("Unique identifier of the index"),
209
+ },
210
+ _meta: { category: "meilisearch" },
211
+ }, async ({ indexUid }) => {
183
212
  try {
184
213
  const response = await apiClient.get(`/indexes/${indexUid}/settings/sortable-attributes`);
185
214
  return {
@@ -192,13 +221,16 @@ export const registerSettingsTools = (server) => {
192
221
  return createErrorResponse(error);
193
222
  }
194
223
  });
195
- // Update sortable attributes setting
196
- server.tool("update-sortable-attributes", "Update the sortable attributes setting for a Meilisearch index", {
197
- indexUid: z.string().describe("Unique identifier of the index"),
198
- sortableAttributes: z
199
- .string()
200
- .describe('JSON array of attributes that can be used for sorting, e.g. ["price", "date"]'),
201
- }, { category: "meilisearch" }, async ({ indexUid, sortableAttributes }) => {
224
+ server.registerTool("update-sortable-attributes", {
225
+ description: "Update the sortable attributes setting for a Meilisearch index",
226
+ inputSchema: {
227
+ indexUid: z.string().describe("Unique identifier of the index"),
228
+ sortableAttributes: z
229
+ .string()
230
+ .describe('JSON array of attributes that can be used for sorting, e.g. ["price", "date"]'),
231
+ },
232
+ _meta: { category: "meilisearch" },
233
+ }, async ({ indexUid, sortableAttributes }) => {
202
234
  try {
203
235
  const response = await apiClient.put(`/indexes/${indexUid}/settings/sortable-attributes`, sortableAttributes);
204
236
  return {
@@ -211,10 +243,13 @@ export const registerSettingsTools = (server) => {
211
243
  return createErrorResponse(error);
212
244
  }
213
245
  });
214
- // Reset sortable attributes setting
215
- server.tool("reset-sortable-attributes", "Reset the sortable attributes setting for a Meilisearch index", {
216
- indexUid: z.string().describe("Unique identifier of the index"),
217
- }, { category: "meilisearch" }, async ({ indexUid }) => {
246
+ server.registerTool("reset-sortable-attributes", {
247
+ description: "Reset the sortable attributes setting for a Meilisearch index",
248
+ inputSchema: {
249
+ indexUid: z.string().describe("Unique identifier of the index"),
250
+ },
251
+ _meta: { category: "meilisearch" },
252
+ }, async ({ indexUid }) => {
218
253
  try {
219
254
  const response = await apiClient.delete(`/indexes/${indexUid}/settings/sortable-attributes`);
220
255
  return {
@@ -227,10 +262,13 @@ export const registerSettingsTools = (server) => {
227
262
  return createErrorResponse(error);
228
263
  }
229
264
  });
230
- // Get searchable attributes setting
231
- server.tool("get-searchable-attributes", "Get the searchable attributes setting for a Meilisearch index", {
232
- indexUid: z.string().describe("Unique identifier of the index"),
233
- }, { category: "meilisearch" }, async ({ indexUid }) => {
265
+ server.registerTool("get-searchable-attributes", {
266
+ description: "Get the searchable attributes setting for a Meilisearch index",
267
+ inputSchema: {
268
+ indexUid: z.string().describe("Unique identifier of the index"),
269
+ },
270
+ _meta: { category: "meilisearch" },
271
+ }, async ({ indexUid }) => {
234
272
  try {
235
273
  const response = await apiClient.get(`/indexes/${indexUid}/settings/searchable-attributes`);
236
274
  return {
@@ -243,13 +281,16 @@ export const registerSettingsTools = (server) => {
243
281
  return createErrorResponse(error);
244
282
  }
245
283
  });
246
- // Update searchable attributes setting
247
- server.tool("update-searchable-attributes", "Update the searchable attributes setting for a Meilisearch index", {
248
- indexUid: z.string().describe("Unique identifier of the index"),
249
- searchableAttributes: z
250
- .string()
251
- .describe('JSON array of attributes that can be searched, e.g. ["title", "description"]'),
252
- }, { category: "meilisearch" }, async ({ indexUid, searchableAttributes }) => {
284
+ server.registerTool("update-searchable-attributes", {
285
+ description: "Update the searchable attributes setting for a Meilisearch index",
286
+ inputSchema: {
287
+ indexUid: z.string().describe("Unique identifier of the index"),
288
+ searchableAttributes: z
289
+ .string()
290
+ .describe('JSON array of attributes that can be searched, e.g. ["title", "description"]'),
291
+ },
292
+ _meta: { category: "meilisearch" },
293
+ }, async ({ indexUid, searchableAttributes }) => {
253
294
  try {
254
295
  const response = await apiClient.put(`/indexes/${indexUid}/settings/searchable-attributes`, searchableAttributes);
255
296
  return {
@@ -262,10 +303,13 @@ export const registerSettingsTools = (server) => {
262
303
  return createErrorResponse(error);
263
304
  }
264
305
  });
265
- // Reset searchable attributes setting
266
- server.tool("reset-searchable-attributes", "Reset the searchable attributes setting for a Meilisearch index", {
267
- indexUid: z.string().describe("Unique identifier of the index"),
268
- }, { category: "meilisearch" }, async ({ indexUid }) => {
306
+ server.registerTool("reset-searchable-attributes", {
307
+ description: "Reset the searchable attributes setting for a Meilisearch index",
308
+ inputSchema: {
309
+ indexUid: z.string().describe("Unique identifier of the index"),
310
+ },
311
+ _meta: { category: "meilisearch" },
312
+ }, async ({ indexUid }) => {
269
313
  try {
270
314
  const response = await apiClient.delete(`/indexes/${indexUid}/settings/searchable-attributes`);
271
315
  return {
@@ -278,10 +322,13 @@ export const registerSettingsTools = (server) => {
278
322
  return createErrorResponse(error);
279
323
  }
280
324
  });
281
- // Get ranking rules setting
282
- server.tool("get-ranking-rules", "Get the ranking rules setting for a Meilisearch index", {
283
- indexUid: z.string().describe("Unique identifier of the index"),
284
- }, { category: "meilisearch" }, async ({ indexUid }) => {
325
+ server.registerTool("get-ranking-rules", {
326
+ description: "Get the ranking rules setting for a Meilisearch index",
327
+ inputSchema: {
328
+ indexUid: z.string().describe("Unique identifier of the index"),
329
+ },
330
+ _meta: { category: "meilisearch" },
331
+ }, async ({ indexUid }) => {
285
332
  try {
286
333
  const response = await apiClient.get(`/indexes/${indexUid}/settings/ranking-rules`);
287
334
  return {
@@ -294,13 +341,16 @@ export const registerSettingsTools = (server) => {
294
341
  return createErrorResponse(error);
295
342
  }
296
343
  });
297
- // Update ranking rules setting
298
- server.tool("update-ranking-rules", "Update the ranking rules setting for a Meilisearch index", {
299
- indexUid: z.string().describe("Unique identifier of the index"),
300
- rankingRules: z
301
- .string()
302
- .describe('JSON array of ranking rules, e.g. ["typo", "words", "proximity", "attribute", "sort", "exactness"]'),
303
- }, { category: "meilisearch" }, async ({ indexUid, rankingRules }) => {
344
+ server.registerTool("update-ranking-rules", {
345
+ description: "Update the ranking rules setting for a Meilisearch index",
346
+ inputSchema: {
347
+ indexUid: z.string().describe("Unique identifier of the index"),
348
+ rankingRules: z
349
+ .string()
350
+ .describe('JSON array of ranking rules, e.g. ["typo", "words", "proximity", "attribute", "sort", "exactness"]'),
351
+ },
352
+ _meta: { category: "meilisearch" },
353
+ }, async ({ indexUid, rankingRules }) => {
304
354
  try {
305
355
  const response = await apiClient.put(`/indexes/${indexUid}/settings/ranking-rules`, rankingRules);
306
356
  return {
@@ -313,10 +363,13 @@ export const registerSettingsTools = (server) => {
313
363
  return createErrorResponse(error);
314
364
  }
315
365
  });
316
- // Reset ranking rules setting
317
- server.tool("reset-ranking-rules", "Reset the ranking rules setting for a Meilisearch index", {
318
- indexUid: z.string().describe("Unique identifier of the index"),
319
- }, { category: "meilisearch" }, async ({ indexUid }) => {
366
+ server.registerTool("reset-ranking-rules", {
367
+ description: "Reset the ranking rules setting for a Meilisearch index",
368
+ inputSchema: {
369
+ indexUid: z.string().describe("Unique identifier of the index"),
370
+ },
371
+ _meta: { category: "meilisearch" },
372
+ }, async ({ indexUid }) => {
320
373
  try {
321
374
  const response = await apiClient.delete(`/indexes/${indexUid}/settings/ranking-rules`);
322
375
  return {
@@ -329,10 +382,13 @@ export const registerSettingsTools = (server) => {
329
382
  return createErrorResponse(error);
330
383
  }
331
384
  });
332
- // Get stop words setting
333
- server.tool("get-stop-words", "Get the stop words setting for a Meilisearch index", {
334
- indexUid: z.string().describe("Unique identifier of the index"),
335
- }, { category: "meilisearch" }, async ({ indexUid }) => {
385
+ server.registerTool("get-stop-words", {
386
+ description: "Get the stop words setting for a Meilisearch index",
387
+ inputSchema: {
388
+ indexUid: z.string().describe("Unique identifier of the index"),
389
+ },
390
+ _meta: { category: "meilisearch" },
391
+ }, async ({ indexUid }) => {
336
392
  try {
337
393
  const response = await apiClient.get(`/indexes/${indexUid}/settings/stop-words`);
338
394
  return {
@@ -345,13 +401,16 @@ export const registerSettingsTools = (server) => {
345
401
  return createErrorResponse(error);
346
402
  }
347
403
  });
348
- // Update stop words setting
349
- server.tool("update-stop-words", "Update the stop words setting for a Meilisearch index", {
350
- indexUid: z.string().describe("Unique identifier of the index"),
351
- stopWords: z
352
- .string()
353
- .describe('JSON array of words to ignore in search queries, e.g. ["the", "a", "an"]'),
354
- }, { category: "meilisearch" }, async ({ indexUid, stopWords }) => {
404
+ server.registerTool("update-stop-words", {
405
+ description: "Update the stop words setting for a Meilisearch index",
406
+ inputSchema: {
407
+ indexUid: z.string().describe("Unique identifier of the index"),
408
+ stopWords: z
409
+ .string()
410
+ .describe('JSON array of words to ignore in search queries, e.g. ["the", "a", "an"]'),
411
+ },
412
+ _meta: { category: "meilisearch" },
413
+ }, async ({ indexUid, stopWords }) => {
355
414
  try {
356
415
  const response = await apiClient.put(`/indexes/${indexUid}/settings/stop-words`, stopWords);
357
416
  return {
@@ -364,10 +423,13 @@ export const registerSettingsTools = (server) => {
364
423
  return createErrorResponse(error);
365
424
  }
366
425
  });
367
- // Reset stop words setting
368
- server.tool("reset-stop-words", "Reset the stop words setting for a Meilisearch index", {
369
- indexUid: z.string().describe("Unique identifier of the index"),
370
- }, { category: "meilisearch" }, async ({ indexUid }) => {
426
+ server.registerTool("reset-stop-words", {
427
+ description: "Reset the stop words setting for a Meilisearch index",
428
+ inputSchema: {
429
+ indexUid: z.string().describe("Unique identifier of the index"),
430
+ },
431
+ _meta: { category: "meilisearch" },
432
+ }, async ({ indexUid }) => {
371
433
  try {
372
434
  const response = await apiClient.delete(`/indexes/${indexUid}/settings/stop-words`);
373
435
  return {
@@ -380,10 +442,13 @@ export const registerSettingsTools = (server) => {
380
442
  return createErrorResponse(error);
381
443
  }
382
444
  });
383
- // Get synonyms setting
384
- server.tool("get-synonyms", "Get the synonyms setting for a Meilisearch index", {
385
- indexUid: z.string().describe("Unique identifier of the index"),
386
- }, { category: "meilisearch" }, async ({ indexUid }) => {
445
+ server.registerTool("get-synonyms", {
446
+ description: "Get the synonyms setting for a Meilisearch index",
447
+ inputSchema: {
448
+ indexUid: z.string().describe("Unique identifier of the index"),
449
+ },
450
+ _meta: { category: "meilisearch" },
451
+ }, async ({ indexUid }) => {
387
452
  try {
388
453
  const response = await apiClient.get(`/indexes/${indexUid}/settings/synonyms`);
389
454
  return {
@@ -396,13 +461,16 @@ export const registerSettingsTools = (server) => {
396
461
  return createErrorResponse(error);
397
462
  }
398
463
  });
399
- // Update synonyms setting
400
- server.tool("update-synonyms", "Update the synonyms setting for a Meilisearch index", {
401
- indexUid: z.string().describe("Unique identifier of the index"),
402
- synonyms: z
403
- .string()
404
- .describe('JSON object mapping words to their synonyms, e.g. {"movie": ["film"]}'),
405
- }, { category: "meilisearch" }, async ({ indexUid, synonyms }) => {
464
+ server.registerTool("update-synonyms", {
465
+ description: "Update the synonyms setting for a Meilisearch index",
466
+ inputSchema: {
467
+ indexUid: z.string().describe("Unique identifier of the index"),
468
+ synonyms: z
469
+ .string()
470
+ .describe('JSON object mapping words to their synonyms, e.g. {"movie": ["film"]}'),
471
+ },
472
+ _meta: { category: "meilisearch" },
473
+ }, async ({ indexUid, synonyms }) => {
406
474
  try {
407
475
  const response = await apiClient.put(`/indexes/${indexUid}/settings/synonyms`, synonyms);
408
476
  return {
@@ -415,10 +483,13 @@ export const registerSettingsTools = (server) => {
415
483
  return createErrorResponse(error);
416
484
  }
417
485
  });
418
- // Reset synonyms setting
419
- server.tool("reset-synonyms", "Reset the synonyms setting for a Meilisearch index", {
420
- indexUid: z.string().describe("Unique identifier of the index"),
421
- }, { category: "meilisearch" }, async ({ indexUid }) => {
486
+ server.registerTool("reset-synonyms", {
487
+ description: "Reset the synonyms setting for a Meilisearch index",
488
+ inputSchema: {
489
+ indexUid: z.string().describe("Unique identifier of the index"),
490
+ },
491
+ _meta: { category: "meilisearch" },
492
+ }, async ({ indexUid }) => {
422
493
  try {
423
494
  const response = await apiClient.delete(`/indexes/${indexUid}/settings/synonyms`);
424
495
  return {
@@ -431,10 +502,13 @@ export const registerSettingsTools = (server) => {
431
502
  return createErrorResponse(error);
432
503
  }
433
504
  });
434
- // Get typo tolerance setting
435
- server.tool("get-typo-tolerance", "Get the typo tolerance setting for a Meilisearch index", {
436
- indexUid: z.string().describe("Unique identifier of the index"),
437
- }, { category: "meilisearch" }, async ({ indexUid }) => {
505
+ server.registerTool("get-typo-tolerance", {
506
+ description: "Get the typo tolerance setting for a Meilisearch index",
507
+ inputSchema: {
508
+ indexUid: z.string().describe("Unique identifier of the index"),
509
+ },
510
+ _meta: { category: "meilisearch" },
511
+ }, async ({ indexUid }) => {
438
512
  try {
439
513
  const response = await apiClient.get(`/indexes/${indexUid}/settings/typo-tolerance`);
440
514
  return {
@@ -447,13 +521,16 @@ export const registerSettingsTools = (server) => {
447
521
  return createErrorResponse(error);
448
522
  }
449
523
  });
450
- // Update typo tolerance setting
451
- server.tool("update-typo-tolerance", "Update the typo tolerance setting for a Meilisearch index", {
452
- indexUid: z.string().describe("Unique identifier of the index"),
453
- typoTolerance: z
454
- .string()
455
- .describe('JSON object with typo tolerance configuration, e.g. {"enabled": true, "minWordSizeForTypos": {"oneTypo": 5, "twoTypos": 9}}'),
456
- }, { category: "meilisearch" }, async ({ indexUid, typoTolerance }) => {
524
+ server.registerTool("update-typo-tolerance", {
525
+ description: "Update the typo tolerance setting for a Meilisearch index",
526
+ inputSchema: {
527
+ indexUid: z.string().describe("Unique identifier of the index"),
528
+ typoTolerance: z
529
+ .string()
530
+ .describe('JSON object with typo tolerance configuration, e.g. {"enabled": true, "minWordSizeForTypos": {"oneTypo": 5, "twoTypos": 9}}'),
531
+ },
532
+ _meta: { category: "meilisearch" },
533
+ }, async ({ indexUid, typoTolerance }) => {
457
534
  try {
458
535
  const response = await apiClient.put(`/indexes/${indexUid}/settings/typo-tolerance`, typoTolerance);
459
536
  return {
@@ -466,10 +543,13 @@ export const registerSettingsTools = (server) => {
466
543
  return createErrorResponse(error);
467
544
  }
468
545
  });
469
- // Reset typo tolerance setting
470
- server.tool("reset-typo-tolerance", "Reset the typo tolerance setting for a Meilisearch index", {
471
- indexUid: z.string().describe("Unique identifier of the index"),
472
- }, { category: "meilisearch" }, async ({ indexUid }) => {
546
+ server.registerTool("reset-typo-tolerance", {
547
+ description: "Reset the typo tolerance setting for a Meilisearch index",
548
+ inputSchema: {
549
+ indexUid: z.string().describe("Unique identifier of the index"),
550
+ },
551
+ _meta: { category: "meilisearch" },
552
+ }, async ({ indexUid }) => {
473
553
  try {
474
554
  const response = await apiClient.delete(`/indexes/${indexUid}/settings/typo-tolerance`);
475
555
  return {
@@ -482,10 +562,13 @@ export const registerSettingsTools = (server) => {
482
562
  return createErrorResponse(error);
483
563
  }
484
564
  });
485
- // Get pagination setting
486
- server.tool("get-pagination", "Get the pagination setting for a Meilisearch index", {
487
- indexUid: z.string().describe("Unique identifier of the index"),
488
- }, { category: "meilisearch" }, async ({ indexUid }) => {
565
+ server.registerTool("get-pagination", {
566
+ description: "Get the pagination setting for a Meilisearch index",
567
+ inputSchema: {
568
+ indexUid: z.string().describe("Unique identifier of the index"),
569
+ },
570
+ _meta: { category: "meilisearch" },
571
+ }, async ({ indexUid }) => {
489
572
  try {
490
573
  const response = await apiClient.get(`/indexes/${indexUid}/settings/pagination`);
491
574
  return {
@@ -498,13 +581,16 @@ export const registerSettingsTools = (server) => {
498
581
  return createErrorResponse(error);
499
582
  }
500
583
  });
501
- // Update pagination setting
502
- server.tool("update-pagination", "Update the pagination setting for a Meilisearch index", {
503
- indexUid: z.string().describe("Unique identifier of the index"),
504
- pagination: z
505
- .string()
506
- .describe('JSON object with pagination configuration, e.g. {"maxTotalHits": 1000}'),
507
- }, { category: "meilisearch" }, async ({ indexUid, pagination }) => {
584
+ server.registerTool("update-pagination", {
585
+ description: "Update the pagination setting for a Meilisearch index",
586
+ inputSchema: {
587
+ indexUid: z.string().describe("Unique identifier of the index"),
588
+ pagination: z
589
+ .string()
590
+ .describe('JSON object with pagination configuration, e.g. {"maxTotalHits": 1000}'),
591
+ },
592
+ _meta: { category: "meilisearch" },
593
+ }, async ({ indexUid, pagination }) => {
508
594
  try {
509
595
  const response = await apiClient.put(`/indexes/${indexUid}/settings/pagination`, pagination);
510
596
  return {
@@ -517,10 +603,13 @@ export const registerSettingsTools = (server) => {
517
603
  return createErrorResponse(error);
518
604
  }
519
605
  });
520
- // Reset pagination setting
521
- server.tool("reset-pagination", "Reset the pagination setting for a Meilisearch index", {
522
- indexUid: z.string().describe("Unique identifier of the index"),
523
- }, { category: "meilisearch" }, async ({ indexUid }) => {
606
+ server.registerTool("reset-pagination", {
607
+ description: "Reset the pagination setting for a Meilisearch index",
608
+ inputSchema: {
609
+ indexUid: z.string().describe("Unique identifier of the index"),
610
+ },
611
+ _meta: { category: "meilisearch" },
612
+ }, async ({ indexUid }) => {
524
613
  try {
525
614
  const response = await apiClient.delete(`/indexes/${indexUid}/settings/pagination`);
526
615
  return {
@@ -533,10 +622,13 @@ export const registerSettingsTools = (server) => {
533
622
  return createErrorResponse(error);
534
623
  }
535
624
  });
536
- // Get faceting setting
537
- server.tool("get-faceting", "Get the faceting setting for a Meilisearch index", {
538
- indexUid: z.string().describe("Unique identifier of the index"),
539
- }, { category: "meilisearch" }, async ({ indexUid }) => {
625
+ server.registerTool("get-faceting", {
626
+ description: "Get the faceting setting for a Meilisearch index",
627
+ inputSchema: {
628
+ indexUid: z.string().describe("Unique identifier of the index"),
629
+ },
630
+ _meta: { category: "meilisearch" },
631
+ }, async ({ indexUid }) => {
540
632
  try {
541
633
  const response = await apiClient.get(`/indexes/${indexUid}/settings/faceting`);
542
634
  return {
@@ -549,13 +641,16 @@ export const registerSettingsTools = (server) => {
549
641
  return createErrorResponse(error);
550
642
  }
551
643
  });
552
- // Update faceting setting
553
- server.tool("update-faceting", "Update the faceting setting for a Meilisearch index", {
554
- indexUid: z.string().describe("Unique identifier of the index"),
555
- faceting: z
556
- .string()
557
- .describe('JSON object with faceting configuration, e.g. {"maxValuesPerFacet": 100}'),
558
- }, { category: "meilisearch" }, async ({ indexUid, faceting }) => {
644
+ server.registerTool("update-faceting", {
645
+ description: "Update the faceting setting for a Meilisearch index",
646
+ inputSchema: {
647
+ indexUid: z.string().describe("Unique identifier of the index"),
648
+ faceting: z
649
+ .string()
650
+ .describe('JSON object with faceting configuration, e.g. {"maxValuesPerFacet": 100}'),
651
+ },
652
+ _meta: { category: "meilisearch" },
653
+ }, async ({ indexUid, faceting }) => {
559
654
  try {
560
655
  const response = await apiClient.put(`/indexes/${indexUid}/settings/faceting`, faceting);
561
656
  return {
@@ -568,10 +663,13 @@ export const registerSettingsTools = (server) => {
568
663
  return createErrorResponse(error);
569
664
  }
570
665
  });
571
- // Reset faceting setting
572
- server.tool("reset-faceting", "Reset the faceting setting for a Meilisearch index", {
573
- indexUid: z.string().describe("Unique identifier of the index"),
574
- }, { category: "meilisearch" }, async ({ indexUid }) => {
666
+ server.registerTool("reset-faceting", {
667
+ description: "Reset the faceting setting for a Meilisearch index",
668
+ inputSchema: {
669
+ indexUid: z.string().describe("Unique identifier of the index"),
670
+ },
671
+ _meta: { category: "meilisearch" },
672
+ }, async ({ indexUid }) => {
575
673
  try {
576
674
  const response = await apiClient.delete(`/indexes/${indexUid}/settings/faceting`);
577
675
  return {
@@ -584,10 +682,13 @@ export const registerSettingsTools = (server) => {
584
682
  return createErrorResponse(error);
585
683
  }
586
684
  });
587
- // Get dictionary setting
588
- server.tool("get-dictionary", "Get the dictionary setting for a Meilisearch index", {
589
- indexUid: z.string().describe("Unique identifier of the index"),
590
- }, { category: "meilisearch" }, async ({ indexUid }) => {
685
+ server.registerTool("get-dictionary", {
686
+ description: "Get the dictionary setting for a Meilisearch index",
687
+ inputSchema: {
688
+ indexUid: z.string().describe("Unique identifier of the index"),
689
+ },
690
+ _meta: { category: "meilisearch" },
691
+ }, async ({ indexUid }) => {
591
692
  try {
592
693
  const response = await apiClient.get(`/indexes/${indexUid}/settings/dictionary`);
593
694
  return {
@@ -600,13 +701,16 @@ export const registerSettingsTools = (server) => {
600
701
  return createErrorResponse(error);
601
702
  }
602
703
  });
603
- // Update dictionary setting
604
- server.tool("update-dictionary", "Update the dictionary setting for a Meilisearch index", {
605
- indexUid: z.string().describe("Unique identifier of the index"),
606
- dictionary: z
607
- .string()
608
- .describe('JSON array of words to consider as a single word, e.g. ["San Francisco", "New York"]'),
609
- }, { category: "meilisearch" }, async ({ indexUid, dictionary }) => {
704
+ server.registerTool("update-dictionary", {
705
+ description: "Update the dictionary setting for a Meilisearch index",
706
+ inputSchema: {
707
+ indexUid: z.string().describe("Unique identifier of the index"),
708
+ dictionary: z
709
+ .string()
710
+ .describe('JSON array of words to consider as a single word, e.g. ["San Francisco", "New York"]'),
711
+ },
712
+ _meta: { category: "meilisearch" },
713
+ }, async ({ indexUid, dictionary }) => {
610
714
  try {
611
715
  const response = await apiClient.put(`/indexes/${indexUid}/settings/dictionary`, dictionary);
612
716
  return {
@@ -619,10 +723,13 @@ export const registerSettingsTools = (server) => {
619
723
  return createErrorResponse(error);
620
724
  }
621
725
  });
622
- // Reset dictionary setting
623
- server.tool("reset-dictionary", "Reset the dictionary setting for a Meilisearch index", {
624
- indexUid: z.string().describe("Unique identifier of the index"),
625
- }, { category: "meilisearch" }, async ({ indexUid }) => {
726
+ server.registerTool("reset-dictionary", {
727
+ description: "Reset the dictionary setting for a Meilisearch index",
728
+ inputSchema: {
729
+ indexUid: z.string().describe("Unique identifier of the index"),
730
+ },
731
+ _meta: { category: "meilisearch" },
732
+ }, async ({ indexUid }) => {
626
733
  try {
627
734
  const response = await apiClient.delete(`/indexes/${indexUid}/settings/dictionary`);
628
735
  return {
@@ -635,10 +742,13 @@ export const registerSettingsTools = (server) => {
635
742
  return createErrorResponse(error);
636
743
  }
637
744
  });
638
- // Get proximity precision setting
639
- server.tool("get-proximity-precision", "Get the proximity precision setting for a Meilisearch index", {
640
- indexUid: z.string().describe("Unique identifier of the index"),
641
- }, { category: "meilisearch" }, async ({ indexUid }) => {
745
+ server.registerTool("get-proximity-precision", {
746
+ description: "Get the proximity precision setting for a Meilisearch index",
747
+ inputSchema: {
748
+ indexUid: z.string().describe("Unique identifier of the index"),
749
+ },
750
+ _meta: { category: "meilisearch" },
751
+ }, async ({ indexUid }) => {
642
752
  try {
643
753
  const response = await apiClient.get(`/indexes/${indexUid}/settings/proximity-precision`);
644
754
  return {
@@ -651,13 +761,16 @@ export const registerSettingsTools = (server) => {
651
761
  return createErrorResponse(error);
652
762
  }
653
763
  });
654
- // Update proximity precision setting
655
- server.tool("update-proximity-precision", "Update the proximity precision setting for a Meilisearch index", {
656
- indexUid: z.string().describe("Unique identifier of the index"),
657
- proximityPrecision: z
658
- .string()
659
- .describe("String with proximity precision value, can be 'byWord' or 'byAttribute'"),
660
- }, { category: "meilisearch" }, async ({ indexUid, proximityPrecision }) => {
764
+ server.registerTool("update-proximity-precision", {
765
+ description: "Update the proximity precision setting for a Meilisearch index",
766
+ inputSchema: {
767
+ indexUid: z.string().describe("Unique identifier of the index"),
768
+ proximityPrecision: z
769
+ .string()
770
+ .describe("String with proximity precision value, can be 'byWord' or 'byAttribute'"),
771
+ },
772
+ _meta: { category: "meilisearch" },
773
+ }, async ({ indexUid, proximityPrecision }) => {
661
774
  try {
662
775
  const response = await apiClient.put(`/indexes/${indexUid}/settings/proximity-precision`, proximityPrecision);
663
776
  return {
@@ -670,10 +783,13 @@ export const registerSettingsTools = (server) => {
670
783
  return createErrorResponse(error);
671
784
  }
672
785
  });
673
- // Reset proximity precision setting
674
- server.tool("reset-proximity-precision", "Reset the proximity precision setting for a Meilisearch index", {
675
- indexUid: z.string().describe("Unique identifier of the index"),
676
- }, { category: "meilisearch" }, async ({ indexUid }) => {
786
+ server.registerTool("reset-proximity-precision", {
787
+ description: "Reset the proximity precision setting for a Meilisearch index",
788
+ inputSchema: {
789
+ indexUid: z.string().describe("Unique identifier of the index"),
790
+ },
791
+ _meta: { category: "meilisearch" },
792
+ }, async ({ indexUid }) => {
677
793
  try {
678
794
  const response = await apiClient.delete(`/indexes/${indexUid}/settings/proximity-precision`);
679
795
  return {
@@ -686,10 +802,13 @@ export const registerSettingsTools = (server) => {
686
802
  return createErrorResponse(error);
687
803
  }
688
804
  });
689
- // Get separator tokens setting
690
- server.tool("get-separator-tokens", "Get the separator tokens setting for a Meilisearch index", {
691
- indexUid: z.string().describe("Unique identifier of the index"),
692
- }, { category: "meilisearch" }, async ({ indexUid }) => {
805
+ server.registerTool("get-separator-tokens", {
806
+ description: "Get the separator tokens setting for a Meilisearch index",
807
+ inputSchema: {
808
+ indexUid: z.string().describe("Unique identifier of the index"),
809
+ },
810
+ _meta: { category: "meilisearch" },
811
+ }, async ({ indexUid }) => {
693
812
  try {
694
813
  const response = await apiClient.get(`/indexes/${indexUid}/settings/separator-tokens`);
695
814
  return {
@@ -702,13 +821,16 @@ export const registerSettingsTools = (server) => {
702
821
  return createErrorResponse(error);
703
822
  }
704
823
  });
705
- // Update separator tokens setting
706
- server.tool("update-separator-tokens", "Update the separator tokens setting for a Meilisearch index", {
707
- indexUid: z.string().describe("Unique identifier of the index"),
708
- separatorTokens: z
709
- .string()
710
- .describe('JSON array of tokens that should be considered as word separators, e.g. ["-", "_"]'),
711
- }, { category: "meilisearch" }, async ({ indexUid, separatorTokens }) => {
824
+ server.registerTool("update-separator-tokens", {
825
+ description: "Update the separator tokens setting for a Meilisearch index",
826
+ inputSchema: {
827
+ indexUid: z.string().describe("Unique identifier of the index"),
828
+ separatorTokens: z
829
+ .string()
830
+ .describe('JSON array of tokens that should be considered as word separators, e.g. ["-", "_"]'),
831
+ },
832
+ _meta: { category: "meilisearch" },
833
+ }, async ({ indexUid, separatorTokens }) => {
712
834
  try {
713
835
  const response = await apiClient.put(`/indexes/${indexUid}/settings/separator-tokens`, separatorTokens);
714
836
  return {
@@ -721,10 +843,13 @@ export const registerSettingsTools = (server) => {
721
843
  return createErrorResponse(error);
722
844
  }
723
845
  });
724
- // Reset separator tokens setting
725
- server.tool("reset-separator-tokens", "Reset the separator tokens setting for a Meilisearch index", {
726
- indexUid: z.string().describe("Unique identifier of the index"),
727
- }, { category: "meilisearch" }, async ({ indexUid }) => {
846
+ server.registerTool("reset-separator-tokens", {
847
+ description: "Reset the separator tokens setting for a Meilisearch index",
848
+ inputSchema: {
849
+ indexUid: z.string().describe("Unique identifier of the index"),
850
+ },
851
+ _meta: { category: "meilisearch" },
852
+ }, async ({ indexUid }) => {
728
853
  try {
729
854
  const response = await apiClient.delete(`/indexes/${indexUid}/settings/separator-tokens`);
730
855
  return {
@@ -737,10 +862,13 @@ export const registerSettingsTools = (server) => {
737
862
  return createErrorResponse(error);
738
863
  }
739
864
  });
740
- // Get non-separator tokens setting
741
- server.tool("get-non-separator-tokens", "Get the non-separator tokens setting for a Meilisearch index", {
742
- indexUid: z.string().describe("Unique identifier of the index"),
743
- }, { category: "meilisearch" }, async ({ indexUid }) => {
865
+ server.registerTool("get-non-separator-tokens", {
866
+ description: "Get the non-separator tokens setting for a Meilisearch index",
867
+ inputSchema: {
868
+ indexUid: z.string().describe("Unique identifier of the index"),
869
+ },
870
+ _meta: { category: "meilisearch" },
871
+ }, async ({ indexUid }) => {
744
872
  try {
745
873
  const response = await apiClient.get(`/indexes/${indexUid}/settings/non-separator-tokens`);
746
874
  return {
@@ -753,13 +881,16 @@ export const registerSettingsTools = (server) => {
753
881
  return createErrorResponse(error);
754
882
  }
755
883
  });
756
- // Update non-separator tokens setting
757
- server.tool("update-non-separator-tokens", "Update the non-separator tokens setting for a Meilisearch index", {
758
- indexUid: z.string().describe("Unique identifier of the index"),
759
- nonSeparatorTokens: z
760
- .string()
761
- .describe('JSON array of tokens that should not be considered as word separators, e.g. ["@", "."]'),
762
- }, { category: "meilisearch" }, async ({ indexUid, nonSeparatorTokens }) => {
884
+ server.registerTool("update-non-separator-tokens", {
885
+ description: "Update the non-separator tokens setting for a Meilisearch index",
886
+ inputSchema: {
887
+ indexUid: z.string().describe("Unique identifier of the index"),
888
+ nonSeparatorTokens: z
889
+ .string()
890
+ .describe('JSON array of tokens that should not be considered as word separators, e.g. ["@", "."]'),
891
+ },
892
+ _meta: { category: "meilisearch" },
893
+ }, async ({ indexUid, nonSeparatorTokens }) => {
763
894
  try {
764
895
  const response = await apiClient.put(`/indexes/${indexUid}/settings/non-separator-tokens`, nonSeparatorTokens);
765
896
  return {
@@ -772,10 +903,13 @@ export const registerSettingsTools = (server) => {
772
903
  return createErrorResponse(error);
773
904
  }
774
905
  });
775
- // Reset non-separator tokens setting
776
- server.tool("reset-non-separator-tokens", "Reset the non-separator tokens setting for a Meilisearch index", {
777
- indexUid: z.string().describe("Unique identifier of the index"),
778
- }, { category: "meilisearch" }, async ({ indexUid }) => {
906
+ server.registerTool("reset-non-separator-tokens", {
907
+ description: "Reset the non-separator tokens setting for a Meilisearch index",
908
+ inputSchema: {
909
+ indexUid: z.string().describe("Unique identifier of the index"),
910
+ },
911
+ _meta: { category: "meilisearch" },
912
+ }, async ({ indexUid }) => {
779
913
  try {
780
914
  const response = await apiClient.delete(`/indexes/${indexUid}/settings/non-separator-tokens`);
781
915
  return {
@@ -788,10 +922,13 @@ export const registerSettingsTools = (server) => {
788
922
  return createErrorResponse(error);
789
923
  }
790
924
  });
791
- // Get word dictionary setting
792
- server.tool("get-word-dictionary", "Get the word dictionary setting for a Meilisearch index", {
793
- indexUid: z.string().describe("Unique identifier of the index"),
794
- }, { category: "meilisearch" }, async ({ indexUid }) => {
925
+ server.registerTool("get-word-dictionary", {
926
+ description: "Get the word dictionary setting for a Meilisearch index",
927
+ inputSchema: {
928
+ indexUid: z.string().describe("Unique identifier of the index"),
929
+ },
930
+ _meta: { category: "meilisearch" },
931
+ }, async ({ indexUid }) => {
795
932
  try {
796
933
  const response = await apiClient.get(`/indexes/${indexUid}/settings/word-dictionary`);
797
934
  return {
@@ -804,13 +941,16 @@ export const registerSettingsTools = (server) => {
804
941
  return createErrorResponse(error);
805
942
  }
806
943
  });
807
- // Update word dictionary setting
808
- server.tool("update-word-dictionary", "Update the word dictionary setting for a Meilisearch index", {
809
- indexUid: z.string().describe("Unique identifier of the index"),
810
- wordDictionary: z
811
- .string()
812
- .describe('JSON array of custom words to add to the dictionary, e.g. ["cbuilder", "meilisearch"]'),
813
- }, { category: "meilisearch" }, async ({ indexUid, wordDictionary }) => {
944
+ server.registerTool("update-word-dictionary", {
945
+ description: "Update the word dictionary setting for a Meilisearch index",
946
+ inputSchema: {
947
+ indexUid: z.string().describe("Unique identifier of the index"),
948
+ wordDictionary: z
949
+ .string()
950
+ .describe('JSON array of custom words to add to the dictionary, e.g. ["cbuilder", "meilisearch"]'),
951
+ },
952
+ _meta: { category: "meilisearch" },
953
+ }, async ({ indexUid, wordDictionary }) => {
814
954
  try {
815
955
  const response = await apiClient.put(`/indexes/${indexUid}/settings/word-dictionary`, wordDictionary);
816
956
  return {
@@ -823,10 +963,13 @@ export const registerSettingsTools = (server) => {
823
963
  return createErrorResponse(error);
824
964
  }
825
965
  });
826
- // Reset word dictionary setting
827
- server.tool("reset-word-dictionary", "Reset the word dictionary setting for a Meilisearch index", {
828
- indexUid: z.string().describe("Unique identifier of the index"),
829
- }, { category: "meilisearch" }, async ({ indexUid }) => {
966
+ server.registerTool("reset-word-dictionary", {
967
+ description: "Reset the word dictionary setting for a Meilisearch index",
968
+ inputSchema: {
969
+ indexUid: z.string().describe("Unique identifier of the index"),
970
+ },
971
+ _meta: { category: "meilisearch" },
972
+ }, async ({ indexUid }) => {
830
973
  try {
831
974
  const response = await apiClient.delete(`/indexes/${indexUid}/settings/word-dictionary`);
832
975
  return {