Skip to main content
Glama

mcp-confluent

Official
by confluentinc

delete-topics

Remove Kafka topics by specifying their names to manage and optimize your Confluent Kafka environment. Supports bulk deletion for streamlined topic management.

Instructions

Delete the topic with the given names.

Input Schema

NameRequiredDescriptionDefault
topicNamesYes

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "topicNames": { "items": { "description": "Names of kafka topics to delete", "type": "string" }, "minItems": 1, "type": "array" } }, "required": [ "topicNames" ], "type": "object" }

Implementation Reference

  • DeleteTopicsHandler class implementing the core logic for the 'delete-topics' tool. The handle() method parses input, deletes topics using Kafka admin client, and returns a success response.
    export class DeleteTopicsHandler extends BaseToolHandler { async handle( clientManager: ClientManager, toolArguments: Record<string, unknown>, ): Promise<CallToolResult> { const { topicNames } = deleteKafkaTopicsArguments.parse(toolArguments); await ( await clientManager.getAdminClient() ).deleteTopics({ topics: topicNames }); return this.createResponse(`Deleted Kafka topics: ${topicNames.join(",")}`); } getToolConfig(): ToolConfig { return { name: ToolName.DELETE_TOPICS, description: "Delete the topic with the given names.", inputSchema: deleteKafkaTopicsArguments.shape, }; } getRequiredEnvVars(): EnvVar[] { return ["KAFKA_API_KEY", "KAFKA_API_SECRET", "BOOTSTRAP_SERVERS"]; } }
  • Zod schema defining the input arguments for the delete-topics tool: a non-empty array of topic names.
    const deleteKafkaTopicsArguments = z.object({ topicNames: z .array(z.string().describe("Names of kafka topics to delete")) .nonempty(), });
  • Registration of the DeleteTopicsHandler in the ToolFactory's static handlers Map using the ToolName.DELETE_TOPICS constant.
    [ToolName.DELETE_TOPICS, new DeleteTopicsHandler()],
  • Import statement for the DeleteTopicsHandler in ToolFactory.
    import { DeleteTopicsHandler } from "@src/confluent/tools/handlers/kafka/delete-topics-handler.js";
  • ToolName enum definition for 'delete-topics' used in registration and tool config.
    DELETE_TOPICS = "delete-topics",

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/confluentinc/mcp-confluent'

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