Skip to main content
Glama
lensesio

Lenses MCP Server

by lensesio

set_action_on_kafka_connector

Control Kafka connectors by starting, stopping, restarting, pausing, or resuming them to manage data flow in Apache Kafka clusters.

Instructions

Controls a Kafka connector (start, stop, restart, pause, resume).

Args: environment: The environment name. cluster: The cluster name. connector: The connector name. action: The action to perform. Options: "start", "stop", "restart", "pause", "resume".

Returns: The result of the control operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environmentYes
clusterYes
connectorYes
actionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function decorated with @mcp.tool(), implementing the logic to set an action (start, stop, restart, pause, resume) on a Kafka connector by making a PUT request to the Lenses API endpoint.
    @mcp.tool()
    async def set_action_on_kafka_connector(
        environment: str,
        cluster: str,
        connector: str,
        action: str
    ) -> Dict[str, Any]:
        """
        Controls a Kafka connector (start, stop, restart, pause, resume).
        
        Args:
            environment: The environment name.
            cluster: The cluster name.
            connector: The connector name.
            action: The action to perform. Options: "start", "stop", "restart", "pause", "resume".
        
        Returns:
            The result of the control operation.
        """
        valid_actions = ["start", "stop", "restart", "pause", "resume"]
        if action not in valid_actions:
            raise ValueError(f"Action must be one of: {', '.join(valid_actions)}")
        
        endpoint = f"/api/v1/environments/{environment}/proxy/api/kafka-connect/clusters/{cluster}/connectors/{connector}/{action}"
        return await api_client._make_request("PUT", endpoint)
  • The registration block in the main MCP server file where register_kafka_connectors(mcp) is called, which in turn defines and registers the set_action_on_kafka_connector tool using @mcp.tool() decorator.
    register_environments(mcp)
    register_kafka_connectors(mcp)
    register_kafka_consumer_groups(mcp)
    register_sql(mcp)
    register_sql_processors(mcp)
    register_topics(mcp)
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the tool performs control operations but lacks critical behavioral details: required permissions, whether actions are reversible, potential side effects (e.g., data loss on stop), rate limits, or error conditions. The description adds minimal value beyond the basic action list.

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 and appropriately sized. It front-loads the purpose in the first sentence, followed by organized sections for 'Args' and 'Returns'. Every sentence earns its place, though the 'Returns' section is somewhat vague ('The result of the control operation').

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 (control operations on Kafka connectors), no annotations, and an output schema (which should document return values), the description is moderately complete. It covers parameters well but lacks behavioral context and usage guidelines. The output schema reduces the need to explain returns, but the description could better address mutation risks and sibling tool distinctions.

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 description coverage is 0%, so the description must compensate. It documents all 4 parameters with clear names and provides the 'action' parameter's options ('start', 'stop', 'restart', 'pause', 'resume'), adding significant semantic value. However, it doesn't explain the relationships between parameters (e.g., hierarchy: environment → cluster → connector) or format expectations.

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: 'Controls a Kafka connector (start, stop, restart, pause, resume).' It specifies the verb ('Controls') and resource ('Kafka connector') with specific action examples. However, it doesn't explicitly differentiate from sibling tools like 'restart_kafka_connector_task' or 'validate_connector_configuration', which prevents a perfect score.

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., connector must exist), exclusions, or comparisons to siblings like 'restart_kafka_connector_task' (which might handle task-level restarts). Usage is implied through the action list but not explicitly stated.

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