Skip to main content
Glama

delete_topic

Deletes 1–1000 Kafka topics after previewing message and partition counts, requiring explicit confirmation and data-loss acknowledgement before destructive changes.

Instructions

Delete 1 to 1000 Kafka topics in one call through items. Deleting one topic is an items array of length one.

This is the most destructive tool here. Deleting a topic destroys every message in it, and Kafka has no undo: recreating the topic does not bring the data back. Any consumer group reading it breaks.

Nothing is deleted unless confirm is true; otherwise the response reports, per topic, how many messages would be destroyed, how many partitions it had, and which consumer groups had committed offsets for it. A topic that still holds messages also requires acknowledge_data_loss on its item, so destroying data is never a single unconsidered call.

One confirm covers the whole batch, and deletion is not atomic: topics deleted before a later item failed stay deleted. Results follow items order, each carrying index with result or error. Internal topics are refused. Requires Kafka DELETE permission.

Input Schema

NameRequiredDescriptionDefault
itemsYesThe topics to delete, 1 to 1000 of them. Deleting one topic is an array of length one. Naming the same topic twice is refused before anything is deleted.
confirmNoOptional. When false or omitted, nothing is deleted and the response describes what each deletion would destroy. Must be true to actually delete. One confirm covers the whole batch.

Output Schema

NameRequiredDescriptionDefault
atomicYes
failedYes
appliedYes
resultsYes
succeededYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.2.7
    • changedInput schema / properties / items / description
      Previous value: -"The topics to delete, 1 to 100 of them. Deleting one topic is an array of length one. Naming the same topic twice is refused before anything is deleted."New value: +"The topics to delete, 1 to 1000 of them. Deleting one topic is an array of length one. Naming the same topic twice is refused before anything is deleted."
  2. First observedv0.2.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does it well: it discloses irreversibility ('Kafka has no undo: recreating the topic does not bring the data back'), collateral damage (consumer groups break), the two-stage confirm/acknowledge gating, non-atomic partial-batch failure, result ordering with index/result/error, refusal of internal topics, and the required Kafka DELETE permission. This is exactly the behavioral context annotations would otherwise supply.

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

Conciseness4/5

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

Front-loads the action and scale, then escalates to the destruction warning, then the confirm mechanics, then operational caveats. Dense but every sentence carries weight, with only slight redundancy against the schema (the 'array of length one' point is repeated in the items description).

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

Completeness5/5

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

For a high-risk mutation tool with two params, nested items, and a real output schema, the description covers safety gating, partial-failure semantics, permission requirements, and per-item result shape. Nothing an agent needs before calling correctly is missing.

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?

Schema coverage is 100%, so the baseline is 3; the description nevertheless adds meaning by explaining that one confirm covers the whole batch, that acknowledge_data_loss is per-item and only needed when messages exist, and that results align to items order with an index. Minor overlap with schema text keeps it from a 5.

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

Purpose5/5

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

States a precise verb and resource (delete Kafka topics), the batch shape (1 to 1000 via items, single delete = array of length one), and explicitly positions itself as 'the most destructive tool here', which separates it from siblings like delete_records or delete_consumer_group. An agent knows exactly what this does without opening the schema.

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

Usage Guidelines4/5

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

Gives clear conditions for use: nothing is deleted unless confirm is true, and topics holding messages additionally require acknowledge_data_loss, plus the instruction to preview first for message_count. It does not name an alternative sibling (e.g. describe_topic or sample_messages) for pre-deletion inspection, so it stops short of explicit when-not/alternatives routing.

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