Skip to main content
Glama
SSH MCP Server

SSH MCP Server

by YawLabs

ssh_tail

Read-only

Read the last N lines of a remote file over SSH, optionally filtering by a case-insensitive pattern, to inspect logs without manual tail or grep commands.

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 ssh_exec with manual tail/grep commands.

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?

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety and environment profile is known. The description adds the intended use case context but says nothing about auth requirements, what happens on a missing file or unreachable host, or whether the connection pool/timeout behavior is shared with ssh_exec; the pool caveat lives only in the schema.

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 short sentences: the first defines the operation, the second gives the routing advice. Nothing redundant, and the purpose is front-loaded.

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?

With 9 parameters, full schema coverage, and annotations covering safety, the description is nearly sufficient for correct invocation. The remaining gap is that it never states what comes back (raw lines? exit status? error message on missing file), which matters slightly more because no output schema exists.

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 parameter (host, path, lines, grep, timeout, auth fields) is already documented in structured data. The description mentions line count and grep filtering only in passing and adds no syntax or format 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 filter, which is a precise and non-tautological statement of what the tool does. It is clearly distinguishable from generic execution siblings like ssh_exec or ssh_multi_exec.

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?

Explicitly routes the agent away from the obvious alternative: 'Use this for reading log files instead of ssh_exec with manual tail/grep commands.' It doesn't mention ssh_read_file, which is arguably the closest sibling for plain file reads, so a small differentiation gap remains.

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