Skip to main content
Glama
SSH MCP Server

SSH MCP Server

by YawLabs

ssh_tail

Read-only

Read the last N lines of a file on a remote host, optionally filtering by a grep pattern. Use this for reading log files instead of running tail/grep by hand as a remote shell command.

Instructions

Read the last N lines of a file on a remote host, optionally filtering by a grep pattern. Use this for reading log files instead of running tail/grep by hand as a remote shell command.

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>",
      "path": "<path>"
    },
    "name": "ssh_tail"
  }
}

Input Schema

NameRequiredDescriptionDefault
grepNoCase-insensitive pattern to filter lines
hostYesSSH hostname or IP address
pathYesAbsolute path to the file to tail
portNoSSH port (default: 22)
linesNoNumber of lines to read from the end (default: 100). Must be a positive integer.
timeoutNoCommand timeout in milliseconds (default: 30000). Also the longest the call waits for a free connection-pool slot (SSH_MCP_MAX_POOL_SIZE, default 100) before the command starts; the wait and the command are bounded separately.
passwordNoSSH password. STRONGLY prefer key-based auth (privateKeyPath or ssh-agent). Passwords pass through MCP protocol frames as plaintext and may be logged by the transport or host process.
usernameNoSSH username (default: current user)
privateKeyPathNoPath to SSH private key

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.17.0
    • changedInput schema / properties / timeout / description
      Previous value: -"Command timeout in milliseconds (default: 30000)"New value: +"Command timeout in milliseconds (default: 30000). Also the longest the call waits for a free connection-pool slot (SSH_MCP_MAX_POOL_SIZE, default 100) before the command starts; the wait and the command are bounded separately."
  2. Changed4 schema fields changedv0.11.0
    • changedInput schema / properties / lines / description
      Previous value: -"Number of lines to read from the end (default: 100)"New value: +"Number of lines to read from the end (default: 100). Must be a positive integer."
    • addedInput schema / properties / lines / exclusiveMinimum
      Added value: +0
    • addedInput schema / properties / lines / maximum
      Added value: +9007199254740991
    • changedInput schema / properties / lines / type
      Previous value: -"number"New value: +"integer"
  3. Addedv0.9.1

TDQS

A4/5.0
Behavior3/5

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

The annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is known; the description adds that filtering is case-insensitive-by-implication and that this is preferred over ad-hoc shell invocation. It does not discuss connection-pool behavior, timeout semantics, or what happens on auth failure, though the schema itself documents the timeout/pool interplay and the plaintext-password risk.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, zero waste, with the core capability front-loaded and the guidance on the appropriate alternative placed second. Nothing is repeated from the schema or annotations.

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?

For a nine-parameter read-only tail tool with full schema coverage and no output schema, the description covers purpose and routing adequately. Minor gap: it says nothing about output shape (raw lines vs. numbered) or behavior when the file is missing, though these are low-stakes for a read operation.

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 100%, so every one of the nine parameters is already documented, including defaults, bounds, and the password-security caveat. The description only echoes the line-count and grep parameters, adding no format or syntax detail beyond the schema, so the baseline 3 applies.

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 ('Read the last N lines of a file on a remote host') plus the optional grep filter, which pins down the exact scope. It also differentiates itself from the shell-command route by saying to use this 'instead of running tail/grep by hand as a remote shell command', so an agent can separate it from ssh_exec without opening a 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 a clear when-to-use context ('reading log files') and names the alternative approach it replaces (manual tail/grep via remote shell). It stops short of explicit exclusions, e.g. it never says to use ssh_read_file for whole-file reads or when not to use this.

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