Skip to main content
Glama
confluentinc

mcp-confluent

Official
by confluentinc

list-connectors

Retrieve active Kafka connector names via the Kafka Connect REST API to simplify specific connector read requests on the mcp-confluent server.

Instructions

Retrieve a list of "names" of the active connectors. You can then make a read request for a specific connector by name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseUrlNoThe base URL of the Kafka Connect REST API.
clusterIdNoThe unique identifier for the Kafka cluster.
environmentIdNoThe unique identifier for the environment this resource belongs to.

Implementation Reference

  • The handle method of ListConnectorsHandler class, which executes the logic to list active connectors using the Confluent Cloud REST API.
    async handle( clientManager: ClientManager, toolArguments: Record<string, unknown> | undefined, ): Promise<CallToolResult> { const { clusterId, environmentId, baseUrl } = listConnectorArguments.parse(toolArguments); const environment_id = getEnsuredParam( "KAFKA_ENV_ID", "Environment ID is required", environmentId, ); const kafka_cluster_id = getEnsuredParam( "KAFKA_CLUSTER_ID", "Kafka Cluster ID is required", clusterId, ); if (baseUrl !== undefined && baseUrl !== "") { clientManager.setConfluentCloudRestEndpoint(baseUrl); } const pathBasedClient = wrapAsPathBasedClient( clientManager.getConfluentCloudRestClient(), ); const { data: response, error } = await pathBasedClient[ "/connect/v1/environments/{environment_id}/clusters/{kafka_cluster_id}/connectors" ].GET({ params: { path: { environment_id: environment_id, kafka_cluster_id: kafka_cluster_id, }, }, }); if (error) { return this.createResponse( `Failed to list Confluent Cloud connectors for ${clusterId}: ${JSON.stringify(error)}`, true, ); } return this.createResponse( `Active Connectors: ${JSON.stringify(response?.join(","))}`, ); }
  • Zod schema defining the input arguments for the list-connectors tool: baseUrl, environmentId, clusterId.
    const listConnectorArguments = z.object({ baseUrl: z .string() .trim() .describe("The base URL of the Kafka Connect REST API.") .url() .default(() => env.CONFLUENT_CLOUD_REST_ENDPOINT ?? "") .optional(), environmentId: z .string() .trim() .optional() .describe( "The unique identifier for the environment this resource belongs to.", ), clusterId: z .string() .trim() .optional() .describe("The unique identifier for the Kafka cluster."), });
  • Registration of the ListConnectorsHandler in the ToolFactory's static handlers Map using the tool name.
    [ToolName.LIST_CONNECTORS, new ListConnectorsHandler()],
  • Enum definition for the tool name 'list-connectors' used in registration and configuration.
    LIST_CONNECTORS = "list-connectors",
  • getToolConfig method providing the tool name, description, and input schema for MCP tool registration.
    getToolConfig(): ToolConfig { return { name: ToolName.LIST_CONNECTORS, description: 'Retrieve a list of "names" of the active connectors. You can then make a read request for a specific connector by name.', inputSchema: listConnectorArguments.shape, }; }

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