Skip to main content
Glama

get_pod_logs

Read-only

Fetch diagnostic log lines (errors, panics, stack traces, warnings) from a specific pod in Kubernetes. Supports grep filtering, since duration, previous container, and fallback to recent tail lines.

Instructions

Use only after narrowing to a specific Pod/container. Returns diagnostically relevant log lines (errors, panics, stack traces, warnings) or falls back to recent tail lines. Set grep to server-side filter like kubectl logs | grep PATTERN when you know an error string, request path, service name, or trace id. For broad incidents, first use issues, get_dashboard, search, list_resources, or get_neighborhood to avoid reading logs from many unrelated pods. If the target is a config value, feature flag, CRD field, env ref, or YAML/spec content, use search rather than logs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
grepNooptional regular expression to keep matching log lines before diagnostic filtering, like kubectl logs | grep PATTERN
nameYespod name
sinceNoonly return logs newer than this duration (e.g. 30s, 10m, 1h), like kubectl logs --since
previousNoreturn logs from the previous terminated container instance (e.g. for CrashLoopBackOff diagnosis), like kubectl logs -p
containerNocontainer name, defaults to first container
namespaceYespod namespace
tail_linesNonumber of lines to fetch from the end (default 200)
Behavior4/5

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

The description discloses that logs are filtered to diagnostically relevant lines and may fall back to tail lines, which is a behavioral trait beyond the readOnlyHint annotation. It also explains the grep parameter's server-side filtering behavior. While it does not detail output format or edge cases, it adds meaningful context without contradicting annotations.

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 compact yet information-dense. It front-loads the primary usage condition ('Use only after narrowing'), followed by the core behavior, grep usage, and alternatives. Every sentence adds value without redundancy, achieving high clarity in limited space.

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?

Despite having no output schema, the description sufficiently conveys the return type ('log lines') and fallback behavior. It covers when to use, how to use (grep, since, previous via schema), and when to avoid, making it complete for the tool's complexity. The schema covers parameter details, and the description fills behavioral context.

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 coverage is 100%, providing baseline 3. The description adds extra semantics for the grep parameter, suggesting when to set it: 'when you know an error string, request path, service name, or trace id' and equating it to `kubectl logs | grep PATTERN`. This goes beyond the schema's minimal description and aids effective usage.

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 function: 'Returns diagnostically relevant log lines (errors, panics, stack traces, warnings) or falls back to recent tail lines.' It uses a specific verb ('returns'), names the resource (pod logs), and differentiates from related tools by emphasizing use for a specific Pod/container after narrowing scope, contrasting with broad incident tools.

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?

Explicit guidance is provided: 'Use only after narrowing to a specific Pod/container.' It also states when not to use it, listing alternatives: 'For broad incidents, first use issues, get_dashboard, search, list_resources, or get_neighborhood' and 'If the target is a config value... use search rather than logs.' This clearly distinguishes this tool from siblings and gives concrete conditions.

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/skyhook-io/radar'

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