Skip to main content
Glama
lensesio

Lenses MCP Server

by lensesio

create_kafka_connector

Create and deploy a new Kafka connector by specifying environment, name, cluster, and configuration parameters to manage data flow between systems.

Instructions

Creates a new Kafka connector.

Args: environment: The environment name. name: The name of the connector. cluster: The cluster name where the connector will be deployed. configuration: The connector configuration as a dictionary.

Returns: The created connector object.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environmentYes
nameYes
clusterYes
configurationYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'create_kafka_connector' tool. It constructs a payload with name, cluster, and configuration, then sends a POST request to the Lenses API to create the Kafka connector.
    @mcp.tool()
    async def create_kafka_connector(
        environment: str,
        name: str,
        cluster: str,
        configuration: Dict[str, Any]
    ) -> Dict[str, Any]:
        """
        Creates a new Kafka connector.
        
        Args:
            environment: The environment name.
            name: The name of the connector.
            cluster: The cluster name where the connector will be deployed.
            configuration: The connector configuration as a dictionary.
        
        Returns:
            The created connector object.
        """
        payload = {
            "name": name,
            "cluster": cluster,
            "configuration": configuration
        }
        
        endpoint = f"/api/v1/environments/{environment}/proxy/api/kafka-connect/connectors"
        return await api_client._make_request("POST", endpoint, payload)
  • Invocation of register_kafka_connectors(mcp), which defines and registers the create_kafka_connector tool (along with other Kafka connector tools) with the FastMCP server.
    register_kafka_connectors(mcp)
  • A prompt generator registered with @mcp.prompt() to help generate instructions for creating a Kafka connector.
    @mcp.prompt()
    def generate_create_kafka_connector_prompt(name: str, cluster: str, connector_class: str, environment: str) -> str:
        """Create a Kafka connector with the specified configuration"""
        return f"""
            Please create a Kafka connector named '{name}' in the '{environment}' environment
            on cluster '{cluster}' using connector class '{connector_class}'.
            
            The connector should be configured with appropriate settings for its type.
            """
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 a connector and returns the created object, but lacks details on permissions required, whether this is a mutating operation, potential side effects (e.g., impact on clusters), error conditions, or rate limits. For a creation tool with zero annotation coverage, this is insufficient.

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?

The description is well-structured with clear sections (Args, Returns) and uses minimal sentences. It front-loads the purpose and efficiently documents parameters. However, the 'Args' and 'Returns' labels are slightly redundant with the schema and output schema, and some sentences could be more concise (e.g., 'The created connector object' is vague).

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

Completeness3/5

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

Given the tool's complexity (4 parameters, nested objects, no annotations) and the presence of an output schema, the description is partially complete. It covers the basic purpose and parameters but lacks behavioral context, usage guidelines, and detailed parameter semantics. The output schema reduces the need to explain return values, but overall completeness is moderate with clear gaps.

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 0%, so the description must compensate. It lists all four parameters with brief explanations (e.g., 'environment: The environment name'), adding basic semantics beyond the schema's titles. However, it doesn't elaborate on format constraints, valid values, or how 'configuration' should be structured, leaving gaps for a tool with nested objects.

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 tool's purpose as 'Creates a new Kafka connector' with a specific verb ('Creates') and resource ('Kafka connector'). It distinguishes from siblings like 'delete_kafka_connector' or 'list_kafka_connectors' by specifying creation. However, it doesn't explicitly differentiate from 'validate_connector_configuration' which might be a prerequisite.

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., whether 'validate_connector_configuration' should be used first), exclusions, or comparisons to sibling tools like 'create_sql_processor' or 'create_topic'. Usage is implied only by the tool name and purpose.

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

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/lensesio/lenses-mcp'

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