Skip to main content
Glama

get_k8s_logs

Read-onlyIdempotent

Gets logs from a Kubernetes container in a pod. This is similar to running kubectl logs.

Input Schema

NameRequiredDescriptionDefault
nameYesRequired. The name of the resource to retrieve logs from. This can be a pod name (e.g. "my-pod") or a type/name (e.g. "deployment/my-deployment"). If a type is not specified, "pod" is assumed.
tailNoOptional. The number of lines from the end of the logs to show.
sinceNoOptional. Retrieve logs since this duration ago (e.g. "1h", "10m"). Only one of this field or sinceTime should be set.
parentYesRequired. The cluster to retrieve logs from. Format: projects/{project}/locations/{location}/clusters/{cluster}
previousNoOptional. If true, retrieve logs from the previous instantiation of the container.
containerNoOptional. The name of the container to retrieve logs from. If not specified, logs from the first container are returned.
namespaceNoOptional. The namespace of the resource. If not specified, "default" is used.
sinceTimeNoOptional. Retrieve logs since this time (RFC3339). e.g. "2024-08-30T06:00:00Z". Only one of this field or since should be set.
timestampsNoOptional. If true, include timestamps in the log output.
allContainersNoOptional. If true, retrieve logs from all containers in the pod.

Output Schema

NameRequiredDescriptionDefault
logsNoThe logs from the resources.
errorsNoErrors encountered during log retrieval.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / since / description
      Previous value: -"Optional. Retrieve logs since this duration ago (e.g. \"1h\", \"10m\")."New value: +"Optional. Retrieve logs since this duration ago (e.g. \"1h\", \"10m\"). Only one of this field or sinceTime should be set."
    • changedInput schema / properties / sinceTime / description
      Previous value: -"Optional. Retrieve logs since this time (RFC3339). e.g. \"2024-08-30T06:00:00Z\"."New value: +"Optional. Retrieve logs since this time (RFC3339). e.g. \"2024-08-30T06:00:00Z\". Only one of this field or since should be set."
  2. Added

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare read-only, idempotent, non-destructive behavior, so the description does not need to cover safety. The kubectl logs analogy adds useful behavioral context, but the description does not mention auth requirements, streaming behavior, or how multi-container defaults work.

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 two short, front-loaded sentences with no wasted text. It is perhaps too terse for a 10-parameter tool, but it is efficiently structured.

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?

The schema fully documents parameters and an output schema exists, so the description can be light. However, for a relatively complex log-retrieval tool, it provides no usage context, sibling differentiation, or behavioral nuance beyond the kubectl analogy.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage across all 10 parameters, so the schema already documents their meaning. The description adds no additional parameter semantics beyond the container/pod framing.

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 states a specific verb and resource: retrieving logs from a Kubernetes container in a pod. It is clear what the tool does, but it does not explicitly distinguish itself from nearby siblings such as describe_k8s_resource or list_k8s_events.

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?

The kubectl logs analogy implies the tool's domain, but there is no explicit guidance on when to use this tool versus alternatives. It does not mention sibling tools, exclusions, or prerequisites.

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