Skip to main content
Glama
confluentinc

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

TableJSON Schema
NameRequiredDescriptionDefault
topicNamesYes

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",
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action is 'Delete', implying a destructive mutation, but lacks details on permissions needed, whether deletion is reversible, effects on associated data, or error handling. This is inadequate for a destructive operation without annotation support.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with no wasted words, efficiently conveying the core action and parameter. It's appropriately sized and front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's destructive nature, no annotations, no output schema, and minimal parameter documentation, the description is insufficient. It doesn't cover behavioral aspects like safety warnings, return values, or error conditions, leaving critical gaps for an AI agent to use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context by specifying that 'topicNames' refers to 'the given names', clarifying the parameter's role beyond the schema's basic type definition. With 0% schema description coverage and only 1 parameter, this compensates well, though it could detail format or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and the resource ('topic with the given names'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'delete-connector' or 'delete-flink-statements' beyond specifying the resource type, which slightly limits its distinctiveness.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., topic existence), exclusions, or compare it to related tools like 'remove-tag-from-entity' or 'delete-tag', leaving usage context unclear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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