Skip to main content
Glama

Kubectl logs

kube_logs
Read-only

Retrieve Kubernetes pod logs as timestamped lines, keep newest output under budget, merge repeated messages, and filter by regex with grep instead of shell piping.

Instructions

Get pod logs. lines are as kubectl prints them, ' ', oldest first; consecutive repeats of a message merge into the first, marked ' [×N]', and a budget cut keeps the newest. Use grep to filter lines by regex pattern (e.g. 'ERROR|WARN') instead of piping through shell commands.

Input Schema

NameRequiredDescriptionDefault
podNoRequired. Pod name (or deployment/xxx)
grepNoRegex pattern to filter log lines (e.g. 'ERROR|WARN', 'timeout'). Only matching lines are returned.
tailNoNumber of lines (default 100)
sinceNoDuration like '1h', '30m'
contextNoKube context
maxItemsNoItem cap; overrides detailLevel
containerNoContainer name
namespaceNoNamespacedefault
ignoreCaseNoCase-insensitive grep matching (default: false)
includeRawNoInclude raw/verbose fields
detailLevelNoItem preset: summary 20, normal 100, full (default; also skips the response budget)

Output Schema

NameRequiredDescriptionDefault
linesYes
totalNo
retainedNo
truncatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.0.1

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the description is not required to explain the safety profile. It adds meaningful behavioral detail beyond the annotations: the exact line format, oldest-first ordering, the merging of consecutive repeats into one line marked ' [×N]', and the rule that when the response budget truncates output, the newest lines are kept. This is genuinely useful context for interpreting results.

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 sentences and front-loads the core behavior before the grep advice. The second sentence is dense but contains no filler, though the formatting details could be separated for easier reading.

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?

With 11 parameters, a full schema and a complete output schema, the description still says enough. It covers how log lines are formatted and what happens when the output budget truncates results. The schema covers everything else. Still, the interaction among detailLevel, maxItems, and the budget is only described in the schema.

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?

Schema description coverage is 100%, so the schema already documents all 11 parameters. The description adds only the operational hint that grep should be used instead of shell piping; it gives no additional syntax or format details for tail, since, detailLevel, maxItems, or the budget interaction. This matches the baseline of 3 when the schema itself describes the parameters.

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 first sentence, 'Get pod logs,' gives a specific verb and resource and is immediately actionable. However, it doesn't differentiate this tool from sibling tools such as kube_get or kube_events_summary; for example, it could explain why logs come from this tool rather than from a general kubectl wrapper.

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 'Use grep ... instead of piping through shell commands' sentence explains how to use the grep parameter, not when to prefer this tool over alternatives. No explicit guidance about when this tool should be used instead of its siblings is present, so the agent can only infer usage.

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