Skip to main content
Glama
lensesio

Lenses MCP Server

by lensesio

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

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):
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavior. It states the tool returns logs as a string, but omits critical details like whether logs are streamed or truncated, time ranges, error handling for non-existent pods, or authentication needs. This is a significant gap for a tool with potential operational impact.

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 with clear sections for purpose, args, and returns. It uses minimal sentences without redundancy. However, the 'Args' and 'Returns' sections could be integrated more seamlessly, and some details are sparse.

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 no annotations, 0% schema coverage, but an output schema exists (implied by 'Returns'), the description is moderately complete. It covers the basic purpose and parameters but lacks behavioral context and usage guidelines, which are important for a tool interacting with Kubernetes resources.

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 lists all four parameters with brief explanations (e.g., 'Pod's name'), adding meaning beyond the schema's titles. However, it does not specify formats or constraints (e.g., valid environment names), leaving some ambiguity.

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: 'Returns the logs produced by a running Kubernetes Pod.' It specifies the verb ('returns') and resource ('logs'), but does not differentiate from sibling tools, as none appear to be log-related. The title is null, so the description carries the full burden.

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?

No guidance is provided on when to use this tool versus alternatives. The description does not mention prerequisites, such as requiring the pod to be running, or suggest other tools for similar tasks. It lacks context for selection among siblings.

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