Skip to main content
Glama
confluentinc

mcp-confluent

Official
by confluentinc

search-topics-by-name

Find specific Kafka topics in your cluster by name using the Schema Registry REST API. Streamline topic identification for Confluent Kafka or Confluent Cloud environments.

Instructions

List all topics in the Kafka cluster matching the specified name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseUrlNoThe base URL of the Schema Registry REST API.
topicNameYesThe topic name to search for

Implementation Reference

  • The handle method of SearchTopicsByNameHandler that executes the tool: parses args, calls Schema Registry API to search topics by name, and returns matching topic names.
    async handle(
      clientManager: ClientManager,
      toolArguments: Record<string, unknown>,
    ): Promise<CallToolResult> {
      const { topicName, baseUrl } =
        searchTopicsByNameArguments.parse(toolArguments);
      if (baseUrl !== undefined && baseUrl !== "") {
        clientManager.setConfluentCloudSchemaRegistryEndpoint(baseUrl);
      }
      const pathBasedClient = wrapAsPathBasedClient(
        clientManager.getConfluentCloudSchemaRegistryRestClient(),
      );
      const { data: response, error } = await pathBasedClient[
        "/catalog/v1/search/basic?types=kafka_topic&query={topicName}"
      ].GET({
        params: {
          path: {
            topicName: topicName,
          },
        },
      });
      if (error) {
        return this.createResponse(
          `Failed to search for topics by name: ${JSON.stringify(error)}`,
          true,
        );
      }
      return this.createResponse(
        response?.entities
          ?.map((entity) => entity.attributes?.qualifiedName)
          .filter(Boolean)
          .join(", ") || "No matching topics found",
      );
    }
  • Zod input schema defining parameters: topicName (required string) and optional baseUrl.
    const searchTopicsByNameArguments = z.object({
      baseUrl: z
        .string()
        .describe("The base URL of the Schema Registry REST API.")
        .url()
        .default(() => env.SCHEMA_REGISTRY_ENDPOINT ?? "")
        .optional(),
      topicName: z.string().describe("The topic name to search for"),
    });
  • Registration of the SearchTopicsByNameHandler in the ToolFactory's handlers Map using the tool name constant.
    [ToolName.SEARCH_TOPICS_BY_NAME, new SearchTopicsByNameHandler()],
  • ToolName enum constant defining the string identifier 'search-topics-by-name' used for registration and configuration.
    SEARCH_TOPICS_BY_NAME = "search-topics-by-name",
  • getToolConfig method providing the tool name, description, and inputSchema for MCP tool registration.
    getToolConfig(): ToolConfig {
      return {
        name: ToolName.SEARCH_TOPICS_BY_NAME,
        description:
          "List all topics in the Kafka cluster matching the specified name.",
        inputSchema: searchTopicsByNameArguments.shape,
      };
    }
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 implies a read-only operation ('List') but doesn't specify whether it requires authentication, rate limits, pagination behavior, or error conditions. For a search tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 is appropriately sized and front-loaded, with every word contributing to understanding the core functionality.

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?

For a search tool with no annotations and no output schema, the description is insufficient. It doesn't explain what the output looks like (e.g., list format, fields returned), error handling, or behavioral constraints. The description alone leaves too many operational questions unanswered.

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?

Schema description coverage is 100%, so the schema already fully documents both parameters (baseUrl and topicName). The description mentions 'the specified name' which aligns with topicName but adds no additional semantic context beyond what the schema provides. This meets the baseline for high schema coverage.

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 ('List all topics') and resource ('in the Kafka cluster') with a specific filter ('matching the specified name'). It distinguishes from general listing tools like 'list-topics' by specifying search functionality, though it doesn't explicitly differentiate from 'search-topics-by-tag' which searches by a different attribute.

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 like 'list-topics' (for unfiltered listing) or 'search-topics-by-tag' (for tag-based search). It states what the tool does but offers no context about use cases, prerequisites, or exclusions.

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