reset-displayed-attributes
Restore default displayed attributes for a Meilisearch index to control which fields appear in search results.
Instructions
Reset the displayed attributes setting to its default value
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| indexUid | Yes | Unique identifier of the index |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"indexUid": {
"description": "Unique identifier of the index",
"type": "string"
}
},
"required": [
"indexUid"
],
"type": "object"
}
Implementation Reference
- src/tools/settings-tools.ts:319-328 (handler)The handler function for the reset-displayed-attributes tool (shared with other reset tools), which performs a DELETE request to `/indexes/${indexUid}/settings/${endpoint}` (endpoint='displayed-attributes') using the apiClient and returns the response or error.async ({ indexUid }) => { try { const response = await apiClient.delete(`/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:316-318 (schema)Input schema definition for the reset-displayed-attributes tool (shared): requires 'indexUid' parameter as a string describing the unique identifier of the index.{ indexUid: z.string().describe("Unique identifier of the index"), },
- src/tools/settings-tools.ts:259-263 (registration)Specific configuration object in the resetSettingsTools array defining the tool name 'reset-displayed-attributes', its endpoint 'displayed-attributes', and description.{ name: "reset-displayed-attributes", endpoint: "displayed-attributes", description: "Reset the displayed attributes setting to its default value", },
- src/tools/settings-tools.ts:312-330 (registration)forEach loop over resetSettingsTools configurations that registers each tool by calling server.tool(name, description, schema, handler), including the reset-displayed-attributes tool.resetSettingsTools.forEach(({ name, endpoint, description }) => { server.tool( name, description, { indexUid: z.string().describe("Unique identifier of the index"), }, async ({ indexUid }) => { try { const response = await apiClient.delete(`/indexes/${indexUid}/settings/${endpoint}`); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } } ); });