Skip to main content
Glama
awesimon

Elasticsearch MCP Server

delete_index_template

Remove specific Elasticsearch index templates by name to manage and organize data storage structures effectively within the Elasticsearch MCP Server.

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 delete index template logic using Elasticsearch client.
    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:277-290 (registration)
    Registers the 'delete_index_template' tool with the MCP server, defining the input schema and linking to the handler function.
    server.tool( "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 schema for the input parameter 'name' of the delete_index_template tool.
    { name: z .string() .trim() .min(1, "Template name is required") .describe("Name of the template to delete") },

Other Tools

Related Tools

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