get-typo-tolerance
Retrieve the typo tolerance setting for a specific index in Meilisearch to manage search accuracy and user experience. Supports efficient search configuration via the MCP Server.
Instructions
Get the typo tolerance setting
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| indexUid | Yes | Unique identifier of the index |
Implementation Reference
- src/tools/settings-tools.ts:155-164 (handler)Handler function that executes the get-typo-tolerance tool: makes a GET request to the Meilisearch API for the index's typo-tolerance settings using the dynamic endpoint and returns the JSON-formatted response or error.async ({ indexUid }) => { try { const response = await apiClient.get(`/indexes/${indexUid}/settings/${endpoint}`); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } }
- src/tools/settings-tools.ts:152-154 (schema)Input schema validation for the get-typo-tolerance tool using Zod: requires indexUid as a string.{ indexUid: z.string().describe("Unique identifier of the index"), },
- src/tools/settings-tools.ts:130-134 (registration)Configuration entry in specificSettingsTools array that defines the tool name, endpoint (/typo-tolerance), and description for dynamic registration of the get-typo-tolerance tool.{ name: "get-typo-tolerance", endpoint: "typo-tolerance", description: "Get the typo tolerance setting", },
- src/tools/settings-tools.ts:147-166 (registration)Dynamic registration loop for specific settings tools, including get-typo-tolerance, calling server.tool with shared schema and handler.// Create a tool for each specific setting specificSettingsTools.forEach(({ name, endpoint, description }) => { server.tool( name, description, { indexUid: z.string().describe("Unique identifier of the index"), }, async ({ indexUid }) => { try { const response = await apiClient.get(`/indexes/${indexUid}/settings/${endpoint}`); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } } ); });
- src/index.ts:67-67 (registration)Top-level call to registerSettingsTools on the MCP server instance, which includes registration of get-typo-tolerance.registerSettingsTools(server);