get_docker_logs
Fetch recent stdout and stderr log lines from a specific Docker container on a remote Linux host over SSH, including stopped containers and optional time-window filtering.
Instructions
Gets the last lines log lines (stdout and stderr merged) of a SPECIFIC docker container,
given by name or ID, from a remote Linux host via SSH. Works for stopped containers too.
Use get_docker_ps_all first to find container names.
Optional since limits them to a time window: '30 min ago', '2 hours ago', '30m', '1h30m'
or 'YYYY-MM-DD HH:MM:SS' ('today' and 'yesterday' are not supported here).
When the login user cannot reach the docker daemon (not root, not in the docker group),
the command is run through passwordless sudo or doas (sudo -n / doas -n).
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": {
"container": "<container>",
"host": "<host>",
"user": "<user>"
},
"name": "get_docker_logs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | ||
| port | No | ||
| user | Yes | ||
| lines | No | ||
| since | No | ||
| timeout | No | ||
| key_path | No | ||
| password | No | ||
| container | Yes | ||
| accept_new_hostkey | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||