update-embedders
Configure embedders to enhance vector search capabilities in Meilisearch by updating JSON-based settings for specific indexes.
Instructions
Configure embedders for vector search
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| embedders | Yes | JSON object containing embedder configurations | |
| indexUid | Yes | Unique identifier of the index |
Implementation Reference
- src/tools/vector-tools.ts:65-85 (handler)Handler function that implements the core logic of the 'update-embedders' tool: parses embedders configuration and updates Meilisearch index settings.try { // Parse the embedders string to ensure it's valid JSON const parsedEmbedders = JSON.parse(embedders); // Ensure embedders is an object if (typeof parsedEmbedders !== 'object' || parsedEmbedders === null || Array.isArray(parsedEmbedders)) { return { isError: true, content: [{ type: "text", text: "Embedders must be a JSON object" }], }; } const response = await apiClient.patch(`/indexes/${indexUid}/settings/embedders`, parsedEmbedders); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } } );
- src/tools/vector-tools.ts:61-64 (schema)Input schema using Zod for validating parameters indexUid and embedders for the 'update-embedders' tool.indexUid: z.string().describe("Unique identifier of the index"), embedders: z.string().describe("JSON object containing embedder configurations"), }, async ({ indexUid, embedders }) => {
- src/tools/vector-tools.ts:58-86 (registration)Direct registration of the 'update-embedders' tool via server.tool() within the registerVectorTools function."update-embedders", "Configure embedders for vector search", { indexUid: z.string().describe("Unique identifier of the index"), embedders: z.string().describe("JSON object containing embedder configurations"), }, async ({ indexUid, embedders }) => { try { // Parse the embedders string to ensure it's valid JSON const parsedEmbedders = JSON.parse(embedders); // Ensure embedders is an object if (typeof parsedEmbedders !== 'object' || parsedEmbedders === null || Array.isArray(parsedEmbedders)) { return { isError: true, content: [{ type: "text", text: "Embedders must be a JSON object" }], }; } const response = await apiClient.patch(`/indexes/${indexUid}/settings/embedders`, parsedEmbedders); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } } );
- src/index.ts:68-68 (registration)Top-level registration call that invokes registerVectorTools to add vector tools (including 'update-embedders') to the main MCP server.registerVectorTools(server);