Skip to main content
Glama
safe-ssh-mcp

safe-ssh-mcp

by Areso

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

NameRequiredDescriptionDefault
hostYes
portNo
userYes
linesNo
sinceNo
timeoutNo
key_pathNo
passwordNo
containerYes
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?

No annotations are supplied, so the description carries the full behavioral burden and does disclose non-obvious traits: it merges stdout/stderr, works on stopped containers, and transparently explains the sudo -n / doas -n escalation path when the login user cannot reach the daemon. It leaves SSH authentication behavior (password vs key_path, host-key acceptance, timeout semantics) unspecified, so not a 5.

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-loads the core action and scope in the first sentence, then adds prerequisite, the `since` format list, and the sudo caveat. Every sentence carries information, though the run-on first sentence and inline parentheticals reduce scannability slightly.

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

Completeness4/5

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

Given an output schema exists (so return values need not be explained) and there are no annotations, the description covers the hardest parts: daemon access/escalation and the `since` time grammar. Gaps remain around SSH auth parameters and what `timeout` bounds, but an agent can call the tool correctly from what is provided.

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

Parameters3/5

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

Schema description coverage is 0% across 10 parameters, so the description must compensate; it adds real meaning for `container` (name or ID), `lines`, and `since` (enumerated accepted formats plus the notable 'today'/'yesterday' exclusion). The remaining seven parameters (host, port, user, key_path, password, timeout, accept_new_hostkey) get no semantic coverage beyond self-evident names.

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?

States a specific verb and resource ('Gets the last `lines` log lines (stdout and stderr merged)') plus scope ('a SPECIFIC docker container, given by name or ID, from a remote Linux host via SSH'). This cleanly distinguishes it from sibling log tools such as get_crictl_logs and get_kubectl_logs without needing to open the schema.

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

Usage Guidelines4/5

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

Gives explicit prerequisite routing: 'Use get_docker_ps_all first to find container names,' and clarifies it works on stopped containers, which is a real selection criterion. It does not explicitly say when to prefer this over the crictl/kubectl log siblings, so it falls short of full when/when-not coverage.

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