mcp-meilisearch 1.3.8 → 1.3.9
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/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +8 -8
- package/dist/tools/core/ai-tools.d.ts.map +1 -0
- package/dist/tools/{ai-tools.js → core/ai-tools.js} +4 -4
- package/dist/tools/meilisearch/document-tools.d.ts.map +1 -0
- package/dist/tools/{document-tools.js → meilisearch/document-tools.js} +9 -9
- package/dist/tools/meilisearch/index-tools.d.ts.map +1 -0
- package/dist/tools/{index-tools.js → meilisearch/index-tools.js} +8 -8
- package/dist/tools/meilisearch/search-tools.d.ts.map +1 -0
- package/dist/tools/{search-tools.js → meilisearch/search-tools.js} +6 -6
- package/dist/tools/meilisearch/settings-tools.d.ts.map +1 -0
- package/dist/tools/meilisearch/settings-tools.js +798 -0
- package/dist/tools/meilisearch/system-tools.d.ts.map +1 -0
- package/dist/tools/{system-tools.js → meilisearch/system-tools.js} +12 -32
- package/dist/tools/meilisearch/task-tools.d.ts.map +1 -0
- package/dist/tools/{task-tools.js → meilisearch/task-tools.js} +8 -8
- package/dist/tools/meilisearch/vector-tools.d.ts.map +1 -0
- package/dist/tools/{vector-tools.js → meilisearch/vector-tools.js} +8 -8
- package/package.json +4 -4
- package/dist/tools/ai-tools.d.ts.map +0 -1
- package/dist/tools/document-tools.d.ts.map +0 -1
- package/dist/tools/index-tools.d.ts.map +0 -1
- package/dist/tools/search-tools.d.ts.map +0 -1
- package/dist/tools/settings-tools.d.ts.map +0 -1
- package/dist/tools/settings-tools.js +0 -309
- package/dist/tools/system-tools.d.ts.map +0 -1
- package/dist/tools/task-tools.d.ts.map +0 -1
- package/dist/tools/vector-tools.d.ts.map +0 -1
- /package/dist/tools/{ai-tools.d.ts → core/ai-tools.d.ts} +0 -0
- /package/dist/tools/{document-tools.d.ts → meilisearch/document-tools.d.ts} +0 -0
- /package/dist/tools/{index-tools.d.ts → meilisearch/index-tools.d.ts} +0 -0
- /package/dist/tools/{search-tools.d.ts → meilisearch/search-tools.d.ts} +0 -0
- /package/dist/tools/{settings-tools.d.ts → meilisearch/settings-tools.d.ts} +0 -0
- /package/dist/tools/{system-tools.d.ts → meilisearch/system-tools.d.ts} +0 -0
- /package/dist/tools/{task-tools.d.ts → meilisearch/task-tools.d.ts} +0 -0
- /package/dist/tools/{vector-tools.d.ts → meilisearch/vector-tools.d.ts} +0 -0
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAQA,qBAAa,SAAS;IACpB;;;OAGG;IACH,WAAW,EAAE,OAAO,CAAS;IAE7B;;;OAGG;IACH,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACjC,EAAE,CAAM;IAET,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,SAAS,CAA8C;IAC/D,OAAO,CAAC,oBAAoB,CAEZ;gBAEJ,UAAU,EAAE,MAAM;IAI9B;;;OAGG;IACH,sBAAsB,CACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,KAAK,IAAI;IAKzE;;;;;OAKG;IACG,WAAW,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAOhE;;;;OAIG;IACG,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAuBzC,SAAS;
|
|
1
|
+
{"version":3,"file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C;QACjB,IAAI,CAAC,EAAE,GAAG,CAAC;QACX,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IAmCF,OAAO,CAAC,cAAc;IAKtB;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAK/B"}
|
package/dist/client.js
CHANGED
|
@@ -70,7 +70,9 @@ export class MCPClient {
|
|
|
70
70
|
this.tools = [];
|
|
71
71
|
}
|
|
72
72
|
else if (toolsResult.tools && Array.isArray(toolsResult.tools)) {
|
|
73
|
-
this.tools = toolsResult.tools
|
|
73
|
+
this.tools = toolsResult.tools
|
|
74
|
+
.filter(({ annotations }) => annotations?.category !== "core")
|
|
75
|
+
.map((tool) => ({
|
|
74
76
|
name: tool.name,
|
|
75
77
|
description: tool.description ?? "",
|
|
76
78
|
parameters: tool.parameters || {},
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAUvD,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAUpE;;GAEG;AACH,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAED;;GAEG;AACH,UAAU,cAAc;IACtB,SAAS,EAAE,SAAS,CAAC;CACt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protocol/sdk/types.js";
|
|
3
|
-
import registerAITools from "./tools/ai-tools.js";
|
|
4
|
-
import registerTaskTools from "./tools/task-tools.js";
|
|
5
|
-
import registerIndexTools from "./tools/index-tools.js";
|
|
6
|
-
import registerSearchTools from "./tools/search-tools.js";
|
|
7
|
-
import registerSystemTools from "./tools/system-tools.js";
|
|
8
|
-
import registerVectorTools from "./tools/vector-tools.js";
|
|
9
|
-
import registerDocumentTools from "./tools/document-tools.js";
|
|
10
|
-
import registerSettingsTools from "./tools/settings-tools.js";
|
|
3
|
+
import registerAITools from "./tools/core/ai-tools.js";
|
|
11
4
|
import { createErrorResponse } from "./utils/error-handler.js";
|
|
5
|
+
import registerTaskTools from "./tools/meilisearch/task-tools.js";
|
|
12
6
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
7
|
+
import registerIndexTools from "./tools/meilisearch/index-tools.js";
|
|
8
|
+
import registerSearchTools from "./tools/meilisearch/search-tools.js";
|
|
9
|
+
import registerSystemTools from "./tools/meilisearch/system-tools.js";
|
|
10
|
+
import registerVectorTools from "./tools/meilisearch/vector-tools.js";
|
|
11
|
+
import registerDocumentTools from "./tools/meilisearch/document-tools.js";
|
|
12
|
+
import registerSettingsTools from "./tools/meilisearch/settings-tools.js";
|
|
13
13
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
14
14
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
15
15
|
const defaultConfig = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/core/ai-tools.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAapE;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,SAAS,SAyEhD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { AIService } from "
|
|
2
|
+
import { AIService } from "../../utils/ai-handler.js";
|
|
3
3
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
4
|
-
import { createErrorResponse } from "
|
|
4
|
+
import { createErrorResponse } from "../../utils/error-handler.js";
|
|
5
5
|
/**
|
|
6
6
|
* Register AI tools with the MCP server
|
|
7
7
|
* @param server - The MCP server instance
|
|
@@ -13,11 +13,11 @@ export const registerAITools = (server) => {
|
|
|
13
13
|
.array(z.string())
|
|
14
14
|
.optional()
|
|
15
15
|
.describe("Optional array of specific tool names to consider"),
|
|
16
|
-
}, async ({ query, specificTools }) => {
|
|
16
|
+
}, { category: "core" }, async ({ query, specificTools }) => {
|
|
17
17
|
try {
|
|
18
18
|
const aiService = AIService.getInstance();
|
|
19
19
|
const availableTools = Object.entries(server._registeredTools)
|
|
20
|
-
.filter(([
|
|
20
|
+
.filter(([_, { annotations }]) => annotations?.category !== "core")
|
|
21
21
|
.map(([name, { description, inputSchema }]) => {
|
|
22
22
|
const { definitions } = zodToJsonSchema(inputSchema, "parameters");
|
|
23
23
|
return {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/meilisearch/document-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAiDpE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,QAAQ,SAAS,SAyQtD,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import apiClient from "
|
|
3
|
-
import { createErrorResponse } from "
|
|
2
|
+
import apiClient from "../../utils/api-handler.js";
|
|
3
|
+
import { createErrorResponse } from "../../utils/error-handler.js";
|
|
4
4
|
/**
|
|
5
5
|
* Register document management tools with the MCP server
|
|
6
6
|
*
|
|
@@ -26,7 +26,7 @@ export const registerDocumentTools = (server) => {
|
|
|
26
26
|
.optional()
|
|
27
27
|
.describe("Fields to return in the documents"),
|
|
28
28
|
filter: z.string().optional().describe("Filter query to apply"),
|
|
29
|
-
}, async ({ indexUid, limit, offset, fields, filter }) => {
|
|
29
|
+
}, { category: "meilisearch" }, async ({ indexUid, limit, offset, fields, filter }) => {
|
|
30
30
|
try {
|
|
31
31
|
const response = await apiClient.get(`/indexes/${indexUid}/documents`, {
|
|
32
32
|
params: {
|
|
@@ -54,7 +54,7 @@ export const registerDocumentTools = (server) => {
|
|
|
54
54
|
.array(z.string())
|
|
55
55
|
.optional()
|
|
56
56
|
.describe("Fields to return in the document"),
|
|
57
|
-
}, async ({ indexUid, documentId, fields }) => {
|
|
57
|
+
}, { category: "meilisearch" }, async ({ indexUid, documentId, fields }) => {
|
|
58
58
|
try {
|
|
59
59
|
const response = await apiClient.get(`/indexes/${indexUid}/documents/${documentId}`, {
|
|
60
60
|
params: {
|
|
@@ -79,7 +79,7 @@ export const registerDocumentTools = (server) => {
|
|
|
79
79
|
.string()
|
|
80
80
|
.optional()
|
|
81
81
|
.describe("Primary key for the documents"),
|
|
82
|
-
}, async ({ indexUid, documents, primaryKey }) => {
|
|
82
|
+
}, { category: "meilisearch" }, async ({ indexUid, documents, primaryKey }) => {
|
|
83
83
|
try {
|
|
84
84
|
// Parse the documents string to ensure it's valid JSON
|
|
85
85
|
const parsedDocuments = JSON.parse(documents);
|
|
@@ -115,7 +115,7 @@ export const registerDocumentTools = (server) => {
|
|
|
115
115
|
.string()
|
|
116
116
|
.optional()
|
|
117
117
|
.describe("Primary key for the documents"),
|
|
118
|
-
}, async ({ indexUid, documents, primaryKey }) => {
|
|
118
|
+
}, { category: "meilisearch" }, async ({ indexUid, documents, primaryKey }) => {
|
|
119
119
|
try {
|
|
120
120
|
// Parse the documents string to ensure it's valid JSON
|
|
121
121
|
const parsedDocuments = JSON.parse(documents);
|
|
@@ -147,7 +147,7 @@ export const registerDocumentTools = (server) => {
|
|
|
147
147
|
server.tool("delete-document", "Delete a document by its ID from a Meilisearch index", {
|
|
148
148
|
indexUid: z.string().describe("Unique identifier of the index"),
|
|
149
149
|
documentId: z.string().describe("ID of the document to delete"),
|
|
150
|
-
}, async ({ indexUid, documentId }) => {
|
|
150
|
+
}, { category: "meilisearch" }, async ({ indexUid, documentId }) => {
|
|
151
151
|
try {
|
|
152
152
|
const response = await apiClient.delete(`/indexes/${indexUid}/documents/${documentId}`);
|
|
153
153
|
return {
|
|
@@ -164,7 +164,7 @@ export const registerDocumentTools = (server) => {
|
|
|
164
164
|
server.tool("delete-documents", "Delete multiple documents by their IDs from a Meilisearch index", {
|
|
165
165
|
indexUid: z.string().describe("Unique identifier of the index"),
|
|
166
166
|
documentIds: z.string().describe("JSON array of document IDs to delete"),
|
|
167
|
-
}, async ({ indexUid, documentIds }) => {
|
|
167
|
+
}, { category: "meilisearch" }, async ({ indexUid, documentIds }) => {
|
|
168
168
|
try {
|
|
169
169
|
// Parse the document IDs string to ensure it's valid JSON
|
|
170
170
|
const parsedDocumentIds = JSON.parse(documentIds);
|
|
@@ -191,7 +191,7 @@ export const registerDocumentTools = (server) => {
|
|
|
191
191
|
// Delete all documents in an index
|
|
192
192
|
server.tool("delete-all-documents", "Delete all documents in a Meilisearch index", {
|
|
193
193
|
indexUid: z.string().describe("Unique identifier of the index"),
|
|
194
|
-
}, async ({ indexUid }) => {
|
|
194
|
+
}, { category: "meilisearch" }, async ({ indexUid }) => {
|
|
195
195
|
try {
|
|
196
196
|
const response = await apiClient.delete(`/indexes/${indexUid}/documents`);
|
|
197
197
|
return {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/meilisearch/index-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAoCpE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,SAAS,SAmLnD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import apiClient from "
|
|
3
|
-
import { createErrorResponse } from "
|
|
2
|
+
import apiClient from "../../utils/api-handler.js";
|
|
3
|
+
import { createErrorResponse } from "../../utils/error-handler.js";
|
|
4
4
|
/**
|
|
5
5
|
* Register index management tools with the MCP server
|
|
6
6
|
*
|
|
@@ -20,7 +20,7 @@ export const registerIndexTools = (server) => {
|
|
|
20
20
|
.min(0)
|
|
21
21
|
.optional()
|
|
22
22
|
.describe("Number of indexes to skip"),
|
|
23
|
-
}, async ({ limit, offset }) => {
|
|
23
|
+
}, { category: "meilisearch" }, async ({ limit, offset }) => {
|
|
24
24
|
try {
|
|
25
25
|
const response = await apiClient.get("/indexes", {
|
|
26
26
|
params: {
|
|
@@ -41,7 +41,7 @@ export const registerIndexTools = (server) => {
|
|
|
41
41
|
// Get index information
|
|
42
42
|
server.tool("get-index", "Get information about a specific Meilisearch index", {
|
|
43
43
|
indexUid: z.string().describe("Unique identifier of the index"),
|
|
44
|
-
}, async ({ indexUid }) => {
|
|
44
|
+
}, { category: "meilisearch" }, async ({ indexUid }) => {
|
|
45
45
|
try {
|
|
46
46
|
const response = await apiClient.get(`/indexes/${indexUid}`);
|
|
47
47
|
return {
|
|
@@ -58,7 +58,7 @@ export const registerIndexTools = (server) => {
|
|
|
58
58
|
server.tool("create-index", "Create a new Meilisearch index", {
|
|
59
59
|
indexUid: z.string().describe("Unique identifier for the new index"),
|
|
60
60
|
primaryKey: z.string().optional().describe("Primary key for the index"),
|
|
61
|
-
}, async ({ indexUid, primaryKey }) => {
|
|
61
|
+
}, { category: "meilisearch" }, async ({ indexUid, primaryKey }) => {
|
|
62
62
|
try {
|
|
63
63
|
const response = await apiClient.post("/indexes", {
|
|
64
64
|
uid: indexUid,
|
|
@@ -78,7 +78,7 @@ export const registerIndexTools = (server) => {
|
|
|
78
78
|
server.tool("update-index", "Update a Meilisearch index (currently only supports updating the primary key)", {
|
|
79
79
|
indexUid: z.string().describe("Unique identifier of the index"),
|
|
80
80
|
primaryKey: z.string().describe("New primary key for the index"),
|
|
81
|
-
}, async ({ indexUid, primaryKey }) => {
|
|
81
|
+
}, { category: "meilisearch" }, async ({ indexUid, primaryKey }) => {
|
|
82
82
|
try {
|
|
83
83
|
const response = await apiClient.patch(`/indexes/${indexUid}`, {
|
|
84
84
|
primaryKey,
|
|
@@ -96,7 +96,7 @@ export const registerIndexTools = (server) => {
|
|
|
96
96
|
// Delete an index
|
|
97
97
|
server.tool("delete-index", "Delete a Meilisearch index", {
|
|
98
98
|
indexUid: z.string().describe("Unique identifier of the index to delete"),
|
|
99
|
-
}, async ({ indexUid }) => {
|
|
99
|
+
}, { category: "meilisearch" }, async ({ indexUid }) => {
|
|
100
100
|
try {
|
|
101
101
|
const response = await apiClient.delete(`/indexes/${indexUid}`);
|
|
102
102
|
return {
|
|
@@ -114,7 +114,7 @@ export const registerIndexTools = (server) => {
|
|
|
114
114
|
indexes: z
|
|
115
115
|
.string()
|
|
116
116
|
.describe('JSON array of index pairs to swap, e.g. [["movies", "movies_new"]]'),
|
|
117
|
-
}, async ({ indexes }) => {
|
|
117
|
+
}, { category: "meilisearch" }, async ({ indexes }) => {
|
|
118
118
|
try {
|
|
119
119
|
// Parse the indexes string to ensure it's valid JSON
|
|
120
120
|
const parsedIndexes = JSON.parse(indexes);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/meilisearch/search-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkCpE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,QAAQ,SAAS,SAoRpD,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import apiClient from "
|
|
3
|
-
import { createErrorResponse } from "
|
|
2
|
+
import apiClient from "../../utils/api-handler.js";
|
|
3
|
+
import { createErrorResponse } from "../../utils/error-handler.js";
|
|
4
4
|
/**
|
|
5
5
|
* Register search tools with the MCP server
|
|
6
6
|
*
|
|
@@ -60,7 +60,7 @@ export const registerSearchTools = (server) => {
|
|
|
60
60
|
.string()
|
|
61
61
|
.optional()
|
|
62
62
|
.describe("Matching strategy: 'all' or 'last'"),
|
|
63
|
-
}, async ({ indexUid, q, limit, offset, filter, sort, facets, attributesToRetrieve, attributesToCrop, cropLength, attributesToHighlight, highlightPreTag, highlightPostTag, showMatchesPosition, matchingStrategy, }) => {
|
|
63
|
+
}, { category: "meilisearch" }, async ({ indexUid, q, limit, offset, filter, sort, facets, attributesToRetrieve, attributesToCrop, cropLength, attributesToHighlight, highlightPreTag, highlightPostTag, showMatchesPosition, matchingStrategy, }) => {
|
|
64
64
|
try {
|
|
65
65
|
const response = await apiClient.post(`/indexes/${indexUid}/search`, {
|
|
66
66
|
q,
|
|
@@ -93,7 +93,7 @@ export const registerSearchTools = (server) => {
|
|
|
93
93
|
searches: z
|
|
94
94
|
.string()
|
|
95
95
|
.describe("JSON array of search queries, each with indexUid and q fields"),
|
|
96
|
-
}, async ({ searches }) => {
|
|
96
|
+
}, { category: "meilisearch" }, async ({ searches }) => {
|
|
97
97
|
try {
|
|
98
98
|
// Parse the searches string to ensure it's valid JSON
|
|
99
99
|
const parsedSearches = JSON.parse(searches);
|
|
@@ -143,7 +143,7 @@ export const registerSearchTools = (server) => {
|
|
|
143
143
|
.optional()
|
|
144
144
|
.default(["*"])
|
|
145
145
|
.describe("Attributes to include in results"),
|
|
146
|
-
}, async ({ q, limit, attributesToRetrieve }) => {
|
|
146
|
+
}, { category: "meilisearch" }, async ({ q, limit, attributesToRetrieve }) => {
|
|
147
147
|
try {
|
|
148
148
|
const indexesResponse = await apiClient.get("/indexes", {
|
|
149
149
|
params: { limit: 1000 },
|
|
@@ -202,7 +202,7 @@ export const registerSearchTools = (server) => {
|
|
|
202
202
|
.string()
|
|
203
203
|
.optional()
|
|
204
204
|
.describe("Filter to apply to the base search"),
|
|
205
|
-
}, async ({ indexUid, facetName, facetQuery, filter }) => {
|
|
205
|
+
}, { category: "meilisearch" }, async ({ indexUid, facetName, facetQuery, filter }) => {
|
|
206
206
|
try {
|
|
207
207
|
const params = {
|
|
208
208
|
facetName,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/meilisearch/settings-tools.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE;;;;GAIG;AAEH;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,QAAQ,SAAS,SAgqCtD,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|