get_last_logins
Lists recent successful SSH logins to a remote Linux host, newest first, showing user, terminal, source address, and login/logout times; optionally limit results to a time window.
Instructions
Lists recent SUCCESSFUL logins (last, from wtmp) to a remote Linux host via SSH, newest first:
user, terminal, source address, login/logout time. Also shows reboots.
For failed login attempts use get_failed_logins.
On BusyBox hosts (Alpine), where last takes no options, the output is plain last
cut to lines rows: its first line starts with '# BusyBox', times have no year,
and since is not supported (the tool fails with a message saying so).
Optional since limits them to a time window: '30 min ago', '2 hours ago', 'today',
'yesterday' or 'YYYY-MM-DD HH:MM:SS'.
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": {
"host": "<host>",
"user": "<user>"
},
"name": "get_last_logins"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | ||
| port | No | ||
| user | Yes | ||
| lines | No | ||
| since | No | ||
| timeout | No | ||
| key_path | No | ||
| password | No | ||
| accept_new_hostkey | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||