Skip to main content
Glama
confluentinc

mcp-confluent

Official
by confluentinc

create-topics

Use this tool to create new Kafka topics in your Confluent cluster by specifying topic names. It integrates with Confluent Kafka and Confluent Cloud REST APIs for streamlined topic management.

Instructions

Create new topic(s) in the Kafka cluster.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicNamesYes

Implementation Reference

  • CreateTopicsHandler class implementing the core logic for the 'create-topics' tool, including the handle method that creates Kafka topics using the admin client.
    export class CreateTopicsHandler extends BaseToolHandler {
      async handle(
        clientManager: ClientManager,
        toolArguments: Record<string, unknown>,
      ): Promise<CallToolResult> {
        const { topicNames } = createTopicArgs.parse(toolArguments);
        const success = await (
          await clientManager.getAdminClient()
        ).createTopics({
          topics: topicNames.map((name) => ({ topic: name })),
        });
        if (!success) {
          return this.createResponse(
            `Failed to create Kafka topics: ${topicNames.join(",")}`,
            true,
          );
        }
        return this.createResponse(`Created Kafka topics: ${topicNames.join(",")}`);
      }
    
      getToolConfig(): ToolConfig {
        return {
          name: ToolName.CREATE_TOPICS,
          description: "Create one or more Kafka topics.",
          inputSchema: createTopicArgs.shape,
        };
      }
    
      getRequiredEnvVars(): EnvVar[] {
        return ["KAFKA_API_KEY", "KAFKA_API_SECRET", "BOOTSTRAP_SERVERS"];
      }
    }
  • Zod input schema defining the topicNames array for the create-topics tool.
    const createTopicArgs = z.object({
      topicNames: z
        .array(z.string().describe("Names of kafka topics to create"))
        .nonempty(),
    });
  • Registration of the CreateTopicsHandler in the ToolFactory's handlers Map under the CREATE_TOPICS key.
    [ToolName.CREATE_TOPICS, new CreateTopicsHandler()],
  • Enum definition for the tool name 'create-topics' used across the codebase.
    CREATE_TOPICS = "create-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 tool creates topics but doesn't mention critical behaviors like required permissions (e.g., admin rights), potential side effects (e.g., topic creation might affect cluster performance), error handling, or what happens if topics already exist. This is inadequate for a mutation tool with zero annotation coverage.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly. Every part of the sentence earns its place by conveying essential information.

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 complexity of creating Kafka topics (a mutation operation), the lack of annotations, no output schema, and minimal parameter guidance, the description is incomplete. It doesn't cover behavioral aspects, usage context, or result expectations, leaving significant gaps for an agent to operate effectively in this domain.

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

Parameters3/5

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

The description adds no parameter semantics beyond what the schema provides. The schema has 0% description coverage, but the description doesn't compensate by explaining the 'topicNames' parameter (e.g., naming conventions, constraints, or examples). Since there's only one parameter, the baseline is 4, but the lack of any additional context reduces this to 3.

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 ('Create') and resource ('new topic(s) in the Kafka cluster'), making the purpose immediately understandable. However, it doesn't distinguish this tool from potential alternatives like 'create-topic-tags' (which creates tags for topics rather than topics themselves) or 'alter-topic-config' (which modifies existing topics), so it misses full sibling differentiation.

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., needing an existing cluster), exclusions (e.g., not for updating topics), or direct comparisons to siblings like 'create-topic-tags' or 'alter-topic-config'. This leaves the agent with minimal context for tool selection.

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