get_kafka_connector_target_definition
Retrieve the current configuration of a Kafka connector as YAML to inspect, verify, or document its settings.
Instructions
Fetches the current target definition for a Kafka connector.
Args: environment: The environment name. connect_cluster_name: The connect cluster name. connector_name: The connector name.
Returns: The connector definition as a YAML string.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environment | Yes | ||
| connect_cluster_name | Yes | ||
| connector_name | Yes |
Implementation Reference
- The main handler function for the 'get_kafka_connector_target_definition' tool. It is decorated with @mcp.tool() for registration and implements the logic by constructing an API endpoint and making a GET request to retrieve the connector's target definition.@mcp.tool() async def get_kafka_connector_target_definition( environment: str, connect_cluster_name: str, connector_name: str ) -> str: """ Fetches the current target definition for a Kafka connector. Args: environment: The environment name. connect_cluster_name: The connect cluster name. connector_name: The connector name. Returns: The connector definition as a YAML string. """ endpoint = f"/api/v1/environments/{environment}/proxy/api/v1/resource/kafka/connect/{connect_cluster_name}/connector/{connector_name}" return await api_client._make_request("GET", endpoint)
- src/lenses_mcp/server.py:29-29 (registration)Calls the register_kafka_connectors function on the MCP instance, which defines and registers the get_kafka_connector_target_definition tool along with other Kafka connector tools.register_kafka_connectors(mcp)