Skip to main content
Glama
awesimon

Elasticsearch MCP Server

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
NameRequiredDescriptionDefault
nameYesName of the template to delete

Implementation Reference

  • 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); } );
  • 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 }) => {

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/awesimon/elasticsearch-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server