Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PORT | No | Port to listen on (only used with http or sse transport) | 8000 |
| TRANSPORT | No | Transport mode: stdio, http, or sse | stdio |
| LENSES_URL | No | Lenses instance URL in format [scheme]://[host]:[port]. Use https:// for secure connections (automatically uses wss:// for WebSockets) | http://localhost:9991 |
| LENSES_API_KEY | Yes | Your Lenses API key (create via IAM Service Account) | |
| LENSES_API_HTTP_URL | No | Legacy environment variable for HTTP URL (automatically derived from LENSES_URL but can be explicitly set to override) | |
| LENSES_API_HTTP_PORT | No | Legacy environment variable for HTTP port (automatically derived from LENSES_URL but can be explicitly set to override) | |
| LENSES_API_WEBSOCKET_URL | No | Legacy environment variable for WebSocket URL (automatically derived from LENSES_URL but can be explicitly set to override) | |
| LENSES_API_WEBSOCKET_PORT | No | Legacy environment variable for WebSocket port (automatically derived from LENSES_URL but can be explicitly set to override) |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_environments | Lists all Lenses environments. Returns: A list containing all environments with their details including status, metrics, and metadata. |
| get_environment | Retrieves a single Lenses environment by name. Args: name: The name of the environment to retrieve. Returns: A dictionary containing the environment's details including status, metrics, and metadata. |
| create_environment | Creates a new Lenses environment. Args: name: The name of the new environment. Must be a valid resource name (lowercase alphanumeric or hyphens, max 63 chars). display_name: The display name of the environment. If not provided, 'name' will be used. tier: The environment tier. Options: "development", "staging", "production". Default: "development". metadata: Additional metadata as key-value pairs. Returns: The created environment object including the agent_key for setup. |
| check_environment_health | Checks the health status of a Lenses environment. Args: name: The name of the environment to check. Returns: Health status information including agent connection and any issues. |
| list_kafka_connectors | Retrieves a list of all Kafka connectors. Args: environment: The environment name. cluster: Optional list of cluster names to filter by. class_name: Optional list of connector class names to filter by. Returns: A dictionary containing a list of all connectors with their details. |
| get_kafka_connector_target_definition | 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. |
| create_kafka_connector | 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. |
| set_action_on_kafka_connector | 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. |
| restart_kafka_connector_task | Restarts a specific task of a Kafka connector. Args: environment: The environment name. cluster: The cluster name. connector: The connector name. task_id: The task ID to restart. Returns: The result of the task restart operation. |
| delete_kafka_connector | Deletes a Kafka connector. Args: environment: The environment name. cluster: The cluster name. connector: The connector name. Returns: The result of the delete operation. |
| validate_connector_configuration | Validates a Kafka connector configuration. Args: environment: The environment name. name: The name of the connector. cluster: The cluster name. configuration: The connector configuration to validate. Returns: Validation results including configuration details and any errors. |
| list_consumer_groups | Retrieve a list of all Kafka consumer groups. Args: environment: The environment name. Returns: A list of consumer group objects. |
| list_consumer_groups_by_topic | Retrieve a list of consumer groups by a specific topic. Args: environment: The environment name. topic: The name of the topic. Returns: A list of consumer group objects. |
| update_consumer_group_offsets | Update the offset for a consumer group topic-partition tuples. Args: environment: The environment name. group_id: The ID of the consumer group. offsets: A list of topic-partition offset objects. Returns: The result of the update operation. |
| delete_consumer_group_offsets | Delete offsets for a consumer group topic-partition tuples. Args: environment: The environment name. group_id: The ID of the consumer group. offsets: A list of topic-partition objects. Returns: The result of the delete operation. |
| update_consumer_group_topic_partition_offset | Update the offset for a topic-partition for a given group. Args: environment: The environment name. group_id: The ID of the consumer group. topic: The topic name. partition: The partition number. offset: The new offset value. Returns: The result of the update operation. |
| delete_consumer_group_topic_partition_offset | Delete the offset for a topic-partition for a given group. Args: environment: The environment name. group_id: The ID of the consumer group. topic: The topic name. partition: The partition number. Returns: The result of the delete operation. |
| delete_consumer_group | Delete a consumer group. Args: environment: The environment name. group_id: The ID of the consumer group to delete. Returns: The result of the delete operation. |
| execute_sql | Executes SQL statements/queries using Lenses WebSocket API. Args: environment: The environment name. sql: The SQL statement/query to execute. Returns: A list of MessageRecord objects representing the result of the SQL query. |
| list_sql_processors | Retrieves all SQL processor details. Args: environment: The environment name. Returns: A dictionary containing a list of all SQL processors with their details. |
| get_sql_processor | Retrieves a single SQL processor by ID. Args: environment: The environment name. sql_processor_id: SQL processor unique identifier. Returns: Detailed SQL processor information including application, metadata, and deployment status. |
| create_sql_processor | Creates a new SQL processor. Args: environment: The environment name. name: The name of the SQL processor. sql: The SQL query/statement for the processor. deployment: Deployment configuration including details like mode, runners, cluster, namespace, etc. If there are no available deployment targets (Kubernetes or Connect clusters), use 'in process' mode: {{mode: "IN_PROC"}} sql_processor_id: Optional processor ID. If not provided, will be auto-generated. description: Optional description of the processor. tags: Optional list of tags for the processor. Returns: The created SQL processor object with its ID. |
| delete_sql_processor | Removes an existing SQL processor. Args: environment: The environment name. sql_processor_id: SQL processor unique identifier. Returns: Success message confirming the deletion. |
| get_deployment_targets | Returns deployment information including available Kubernetes clusters and Connect clusters. Args: environment: The environment name. Returns: Dictionary containing available deployment targets (Kubernetes clusters and Connect clusters). |
| get_pod_logs | Returns the logs produced by a running Kubernetes Pod. Args: environment: The environment name. cluster: Pod's cluster name. namespace: Pod's namespace. pod: Pod's name. Returns: The logs content as a string. |
| list_topics | Retrieve information about all topics. Args: environment: The environment name. Returns: List of all topics with detailed information. |
| get_topic | Retrieve information about a specific topic. Args: environment: The environment name. topic_name: Name of the topic. Returns: Detailed topic information including partitions, consumers, config, etc. |
| get_topic_partitions | Retrieve detailed partition information including messages and bytes (v2 endpoint). Args: environment: The environment name. topic_name: Name of the topic. Returns: Partition details with message counts, bytes, and JMX timestamp. |
| create_topic | Creates a new Kafka topic with optional configuration. Args: environment: The environment name. topic_name: Topic name. partitions: Number of partitions (default: 1). replication: Replication factor (default: 1). configs: Topic configurations. Returns: Creation result. |
| create_topic_with_schema | Creates a new Kafka topic with optional format and schema configuration. Args: environment: The environment name. name: Topic name. partitions: Number of partitions (default: 1). replication: Replication factor (default: 1). configs: Topic configurations. key_format: Key format (AVRO, JSON, CSV, XML, INT, LONG, STRING, BYTES, etc.). key_schema: Key schema (required for AVRO, JSON, CSV, XML). value_format: Value format. value_schema: Value schema. Returns: Creation result. |
| update_topic_config | Update topic configuration. Args: environment: The environment name. topic_name: Name of the topic. configs: List of config key-value pairs [{"key": "retention.ms", "value": "86400000"}]. Returns: Success message. |
| get_topic_broker_configs | Get broker configurations for a topic. Args: environment: The environment name. topic_name: Name of the topic. Returns: List of broker configuration details. |
| add_topic_partitions | Add partitions to an existing topic. Args: environment: The environment name. topic_name: Name of the topic. partitions: New total number of partitions. Returns: Updated partition count. |
| resend_message | Resend a Kafka message. Args: environment: The environment name. topic_name: Name of the topic. partition: Kafka partition number. offset: Kafka offset. Returns: Resend operation result with partition and offset. |
| list_topic_metadata | List all topic metadata. Args: environment: The environment name. Returns: List of topic metadata including schemas and descriptions. |
| get_topic_metadata | Get metadata for a specific topic. Args: environment: The environment name. topic_name: Name of the topic. Returns: Topic metadata including schema information and tags. |
| update_topic_metadata | - |
| list_datasets | Retrieves a paginated list of datasets (topics and other data sources). Args: environment: The environment name. page: Page number (default: 1). page_size: Items per page (default: 25). search: Search keyword for dataset, fields and description. connections: List of connection names to filter by. tags: List of tag names to filter by. sort_field: Field to sort results by. sort_order: Sorting order - "asc" or "desc" (default: "asc"). include_system: Include system entities (default: False). search_fields: Search field names/documentation (default: True). schema_format: Schema format filter for SchemaRegistrySubject. has_records: Filter based on whether dataset has records. is_compacted: Filter based on compacted status (Kafka only). Returns: Paginated list of datasets with source types. |
| get_dataset | Get a single dataset by connection/name. Args: environment: The environment name. connection: The connection name (e.g., "kafka"). dataset: The dataset name. Returns: Dataset details including fields, policies, permissions, and metadata. |
| get_dataset_message_metrics | Get ranged metrics for a dataset's messages. Args: environment: The environment name. entity_name: The dataset's entity name. Returns: List of message metrics with date and message count. |
| update_dataset_topic_description | Update topic description (in metadata). Args: environment: The environment name. topic_name: Name of the topic. description: The description of the topic. Returns: Success message. |
| update_dataset_topic_tags | Update topic tags (in metadata). Args: environment: The environment name. topic_name: Name of the topic. tags: List of tag names. Returns: Success message. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| list_connected_environments | List all connected environments |
| list_running_kafka_connectors | List all running Kafka connectors in the environment |
| generate_create_kafka_connector_prompt | Create a Kafka connector with the specified configuration |
| troubleshoot_kafka_connector | Troubleshoot a specific Kafka connector |
| validate_kafka_connector_config | Validate a Kafka connector configuration before deployment |
| list_consumer_groups_for_topic | List consumer groups for a specified topic in a specified environment |
| generate_sql_query_for_task | Write a Lenses SQL query to achieve a task |
| list_running_sql_processors | List all running SQL processors in the environment |
| generate_create_sql_processor_prompt | Create a SQL processor with the specified name and SQL query |
| troubleshoot_sql_processor | Troubleshoot a specific SQL processor |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |