Skip to main content
Glama

get_pod_logs

Read-only

Read a pod's container logs: the normal way to see what a workload has printed, for any question about its output, not only failures. Streams live from the cluster through its agent - never a cache - with the newest lines last. Use tail_lines to bound the read, container to pick one container of a multi-container pod, and previous=true for the log of the container instance that DIED, which is what explains a CrashLoopBackOff. For history across restarts or many pods at once, use query_logs. If the cluster is offline or has no agent this refuses rather than returning stale output.

Input Schema

NameRequiredDescriptionDefault
pod_nameYesName of the pod to fetch logs from.
previousNoRead the PREVIOUS container instance's log instead of the current one (kubectl logs --previous). This is what shows why a CrashLoopBackOff pod died, since the current instance has usually not started. Needs a cluster agent on 2.1.1058 or newer: on an older agent the call is REFUSED naming the version, never answered with the current instance's log. A container that has never restarted has no previous log; the answer says so and names the containers that have one.
containerNoSpecific container name if the pod has multiple containers.
namespaceYesKubernetes namespace where the pod is located.
cluster_idYesAnkra cluster id (UUID) the call targets. Discover ids with list_clusters.
tail_linesNoNumber of lines from the end of the logs to return.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / previous / description
      Previous value: -"Read the PREVIOUS container instance's log instead of the current one (kubectl logs --previous). This is what shows why a CrashLoopBackOff pod died, since the current instance has usually not started. Needs a cluster agent on 2.1.1058 or newer: on an older agent the call is REFUSED naming the version, never answered with the current instance's log. A container that has never restarted has no previous log, and that is reported as such rather than resolved to another container."New value: +"Read the PREVIOUS container instance's log instead of the current one (kubectl logs --previous). This is what shows why a CrashLoopBackOff pod died, since the current instance has usually not started. Needs a cluster agent on 2.1.1058 or newer: on an older agent the call is REFUSED naming the version, never answered with the current instance's log. A container that has never restarted has no previous log; the answer says so and names the containers that have one."
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint, so the description carries real weight and delivers: data streams live from the cluster through its agent, is never a cache, newest lines are last, and the call refuses rather than returning stale output when the cluster is offline or has no agent. These are non-obvious failure and freshness semantics an agent could not infer from the schema.

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?

Four sentences, front-loaded with purpose and scope before parameter guidance and the alternative. Dense but every clause carries information; the emphasis-caps (DIED) is slightly heavy-handed but functional.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and six parameters, the description still covers ordering, freshness guarantees, the offline/no-agent refusal, container selection, and the sibling alternative, which is everything needed to call it correctly and interpret its output.

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 100%, so the baseline is 3; the description goes modestly beyond by assigning intent to parameters ('use tail_lines to bound the read', 'container to pick one container of a multi-container pod', previous=true for the instance that DIED). It stops short of adding format or interaction detail the schema doesn't already hold.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Read a pod's container logs') and immediately widens the scope beyond debugging ('for any question about its output, not only failures'). It explicitly contrasts with the sibling query_logs, so an agent can distinguish the two without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use ('the normal way to see what a workload has printed') and when-not ('for history across restarts or many pods at once, use query_logs'). Also prescribes which parameter to reach for in three concrete scenarios (tail_lines, container, previous=true for CrashLoopBackOff).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources