get_pod_logs
Fetch recent logs from a Kubernetes pod. For crashed pods in CrashLoopBackOff, enable the 'previous' flag to view the last container's logs.
Instructions
Fetches logs from a specific pod. Set previous=true to get logs from the pod's last run before a crash — essential for diagnosing CrashLoopBackOff or OOMKilled pods. Use tailLines to limit output to the most recent N lines.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| podName | Yes | Name of the pod. | |
| previous | No | Fetch logs from the previous (crashed) container instance. Critical for CrashLoopBackOff diagnosis. Defaults to false. | |
| namespace | No | Kubernetes namespace. Defaults to "default". | |
| tailLines | No | Number of recent log lines to fetch. Defaults to 100. |