get_pod_logs
Retrieve logs from a running Kubernetes Pod to monitor application performance, debug issues, and analyze container output in specified environments and clusters.
Instructions
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.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environment | Yes | ||
| cluster | Yes | ||
| namespace | Yes | ||
| pod | Yes |
Implementation Reference
- The main handler function for the 'get_pod_logs' tool, decorated with @mcp.tool(). It retrieves Kubernetes pod logs by making an authenticated API request to the Lenses API endpoint.async def get_pod_logs( environment: str, cluster: str, namespace: str, pod: str ) -> str: """ 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. """ endpoint = f"/api/v1/environments/{environment}/proxy/api/v1/k8s/logs/{cluster}/{namespace}/{pod}/download" return await api_client._make_request("GET", endpoint)
- src/lenses_mcp/server.py:31-33 (registration)Calls register_sql_processors(mcp) which defines and registers the get_pod_logs tool (among other SQL processor tools) with the FastMCP server instance.register_sql(mcp) register_sql_processors(mcp) register_topics(mcp)
- src/lenses_mcp/tools/sql_processors.py:10-10 (registration)The registration function that contains the @mcp.tool()-decorated definition of get_pod_logs.def register_sql_processors(mcp: FastMCP):