get_pod_logs
Retrieve the tail of a pod's container logs, with options to read from a previous crashed instance for troubleshooting crash loops.
Instructions
Fetch the tail of a pod's container logs. Set previous=true to read logs from a crashed container's prior instance.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"namespace": "<namespace>",
"pod_name": "<pod_name>"
},
"name": "get_pod_logs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | No | number of lines from the end of the log to return (default 100) | |
| context | No | kubeconfig context (cluster) to target; omit to use the default context | |
| pod_name | Yes | name of the pod | |
| previous | No | return logs from the previous terminated instance of the container; useful for crash loops | |
| container | No | container name; omit for a single-container pod | |
| namespace | Yes | namespace of the pod |