Skip to main content
Glama
safe-ssh-mcp

safe-ssh-mcp

by Areso

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

NameRequiredDescriptionDefault
hostYes
portNo
userYes
linesNo
sinceNo
timeoutNo
key_pathNo
passwordNo
accept_new_hostkeyNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does a lot: it discloses the SSH transport, the output shape, newest-first ordering, that reboots are included, and the concrete failure mode on BusyBox hosts (no year, no since, error message). It does not explain authentication behavior for password vs key_path, what accept_new_hostkey implies, or timeout/connection semantics, which are the main remaining gaps for a 9-parameter remote-execution tool.

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?

Front-loaded with the core purpose, followed by return shape, the sibling alternative, caveats, and parameter notes in a logical order. The BusyBox paragraph is dense but every clause conveys distinct behavior; nothing is redundant filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return-value explanation is not strictly required, and the description already covers output columns and edge-case output anyway. However, for a 9-parameter SSH tool with zero schema descriptions, the absence of any auth/connection guidance (key vs password, host key verification, timeout) leaves real holes an agent must guess at.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, but it only meaningfully explains two of nine parameters: lines (rows are cut to that many) and since (with full accepted formats). host, port, user, timeout, key_path, password, and accept_new_hostkey are left completely undocumented in both schema and description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ('Lists recent SUCCESSFUL logins ... from wtmp'), states scope and ordering ('newest first'), and enumerates the returned columns. It also explicitly distinguishes itself from the sibling get_failed_logins by log type.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It routes the agent away from this tool for failed attempts ('For failed login attempts use get_failed_logins') and gives a concrete condition for using it. It additionally supplies the exact accepted syntax for the since argument and warns when that feature does not work (BusyBox/Alpine).

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