delete_index_template
Remove an Elasticsearch index template by name to manage cluster resources and prevent unwanted index creation.
Instructions
Delete an Elasticsearch index template
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the template to delete |
Implementation Reference
- src/tools/createIndexTemplate.ts:122-152 (handler)The main handler function that executes the deletion of an Elasticsearch index template using the esClient.export async function deleteIndexTemplate( esClient: Client, name: string ) { try { const response = await esClient.indices.deleteIndexTemplate({ name }); return { content: [ { type: "text" as const, text: response.acknowledged ? `Index template "${name}" deleted successfully.` : `Index template delete request sent, but not acknowledged. Check cluster status.` } ] }; } catch (error) { console.error(`Delete index template failed: ${error instanceof Error ? error.message : String(error)}`); return { content: [ { type: "text" as const, text: `Error: ${error instanceof Error ? error.message : String(error)}` } ] }; } }
- src/server.ts:278-291 (registration)MCP server tool registration for 'delete_index_template', including inline schema and handler invocation."delete_index_template", "Delete an Elasticsearch index template", { name: z .string() .trim() .min(1, "Template name is required") .describe("Name of the template to delete") }, async ({ name }) => { return await deleteIndexTemplate(esClient, name); } );
- src/server.ts:281-287 (schema)Zod input schema for the tool, validating the 'name' parameter.name: z .string() .trim() .min(1, "Template name is required") .describe("Name of the template to delete") }, async ({ name }) => {