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

TableJSON 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").
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".
timestampsNoOptional. If true, include timestamps in the log output.
allContainersNoOptional. If true, retrieve logs from all containers in the pod.

Output Schema

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

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, establishing a safe read-only operation. The description adds the `kubectl logs` analogy, which provides a familiar behavioral reference but doesn't disclose additional side effects, rate limits, or failure modes. This is adequate but not substantial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, focused sentence that clearly states the tool's purpose without redundancy. It is concise and front-loaded, making it easy to parse quickly.

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

Completeness4/5

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

The description, combined with the comprehensive input schema and strong annotations, provides enough context for an agent to select and invoke the tool correctly. The kubectl logs analogy aids understanding, and the output schema covers return values, so the description doesn't need to explain them. It is complete but not exceptionally detailed.

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 provides detailed descriptions for all 10 parameters, covering their meanings and defaults. The tool description doesn't add any parameter-level semantics beyond the schema. With 100% schema coverage, the baseline of 3 is appropriate.

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?

The description clearly states the tool's purpose: 'Gets logs from a Kubernetes container in a pod.' The verb 'Gets' and the resource 'logs from a Kubernetes container in a pod' are specific. The comparison to 'kubectl logs' reinforces clarity and distinguishes it from sibling tools like get_k8s_resource or describe_k8s_resource.

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

Usage Guidelines4/5

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

The description provides clear context by likening the tool to `kubectl logs`, making it evident when to use it (retrieving container logs). However, it lacks explicit exclusions or mention of alternative tools (e.g., list_k8s_events for events), so it doesn't fully meet the 'explicit when/when-not' criterion.

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.

TDQS

A3.6/5.0
Disambiguation4/5

Most tools target distinct actions and resources, but a few pairs could confuse agents, such as get_cluster (GKE cluster details) vs get_k8s_cluster_info (kubectl cluster-info), or apply_k8s_manifest vs patch_k8s_resource. Overall, descriptions help clarify the differences.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern in lowercase snake_case (e.g., create_cluster, list_node_pools, get_k8s_logs). There are no mixed conventions or unpredictable naming variations.

Tool Count4/5

With 23 tools, the server covers both GKE cluster management and in-cluster Kubernetes operations, which justifies the count. It is slightly on the heavier side but remains within a reasonable scope for such a broad domain.

Completeness3/5

The tool surface covers create, read, update, and list operations for clusters and node pools, but notably lacks delete_cluster and delete_node_pool. This leaves an obvious lifecycle gap that agents cannot work around without additional tooling.

Resources