Skip to main content
Glama
stereosky

Lenses MCP Server

by stereosky

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
NameRequiredDescriptionDefault
environmentYes
clusterYes
namespaceYes
podYes

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)
  • 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)
  • The registration function that contains the @mcp.tool()-decorated definition of get_pod_logs.
    def register_sql_processors(mcp: FastMCP):

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

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