Skip to main content
Glama

get_pod_logs

Retrieve Kubernetes pod logs with options for namespace, line count, container selection, previous instance, and cluster configuration.

Instructions

获取Pod的日志

Args: name: Pod名称 namespace: Kubernetes命名空间,默认为default lines: 日志行数,默认为100 container: 容器名称,如果Pod有多个容器则需要指定 previous: 是否获取上一实例(崩溃/重启前)的日志,默认为False kubeconfig_path: kubeconfig 文件路径,不指定则使用 cluster_name 或默认集群 cluster_name: 集群配置名称(clusters.json 中的 name),kubeconfig_path 未指定时使用

Returns: 包含Pod日志的结果

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
linesNo
previousNo
containerNo
namespaceNodefault
cluster_nameNo
kubeconfig_pathNo
Behavior3/5

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

No annotations are present, so the description must disclose behavior on its own. It provides useful details about the 'previous' flag for pre-restart logs, default line count, and kubeconfig/cluster_name fallback logic. However, it does not mention permission requirements, error behavior, or what happens when a multi-container pod lacks a specified container.

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 well-structured: a one-line summary, a coherent Args list, and a Returns section. It is appropriately sized for a tool with 7 parameters and avoids redundant filler, earning every sentence's place.

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 tool has no output schema and no annotations, so the description should clarify return value and edge cases. It says only '包含Pod日志的结果' without specifying format or content. Parameter guidance is strong, but behavioral boundaries such as errors or multi-container requirements are incomplete, leaving the description adequate but not fully comprehensive.

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

Parameters5/5

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

Schema description coverage is 0%, but the description's Args section thoroughly explains all 7 parameters, including defaults and special cases like container needed for multi-container pods. It also clarifies the precedence relationship between kubeconfig_path and cluster_name, which the schema does not convey.

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?

Description begins with '获取Pod的日志', clearly stating the tool retrieves Pod logs. This specific verb+resource phrase unambiguously distinguishes it from sibling tools such as exec_pod_command or check_pod_health.

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

Usage Guidelines3/5

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

The description implies its usage context—fetching pod logs—but does not explicitly state when to use it over alternatives, nor does it mention any exclusions or prerequisites. There is no 'when-not-to-use' guidance or reference to sibling tools.

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/Tobewont/k8s-mcp-server'

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