Skip to main content
Glama

ssh_log_search

Read-only

Search remote log files with regex, filter by time window or root access, and return matching lines or just file paths over SSH.

Instructions

Greps log files on the server and returns the matching lines with their paths, or the paths alone when line bodies are not wanted. An empty answer means no match, never a failed search: files that could not be read are listed apart. A time window first skips files untouched in it and then keeps only lines dated inside it, which is what lets a year of logs finish. For the tail of a file, ssh_log_tail is cheaper.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromNoWhich end maxMatches keeps: "end" newest (scans the whole file), "start" oldest (stops reading at the cap). Default: endend
pathYesOne path, a list, or a glob in the file name: "/var/log/*.log". Expanded by the server's find, not a shell — a name with a space or a newline stays one name. A glob in the directory part is refused.
sudoNoRead as root. Straight away for places a plain user cannot read (/root, /var/lib/docker); otherwise retry with true when the answer names what it could not read. Default: false
queryYesRegex, grep -E dialect.
sinceNoWindow: "today" | "2026-08-19" | "2h" | "3d", the day taken from the server. Skips files untouched in it (count reported), then keeps only lines dated inside — 2026-08-19, Aug 19, 19/Aug/2026. Undated file: searched whole and named. Under a day filters files, not lines.
contextNoLines around each match, as grep -C. Excluded by namesOnly. Default: 0
profileYesMachine name.
timeoutNoMilliseconds per file, default 30000. Raise for multi-gigabyte files with from: "end".
namesOnlyNoAnswer = matching paths, no line bodies. One command for the whole list; maxMatches and context do not apply. Default: false
recursiveNoWalk the whole tree, not one level. With a glob: "/etc/nginx/*.conf" reaches those at any depth. Symlinked files are searched, symlinked dirs not descended. Default: false
maxMatchesNoCap per file; reaching it is reported. Default: 200
caseSensitiveNofalse = case ignored. Default: false

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesNoMatching file names, for namesOnly.
linesNoThe matching lines. context:true marks a neighbour shown alongside, not a match.
limitedNomaxMatches was reached — more exist than are shown.
matchesNoLines in the answer — matches plus any context lines; with namesOnly, matching files.
truncatedNoOutput was cut mid-answer: incomplete, not empty.
files_skippedNoLeft unread by the since window.
files_undatedNoNo recognisable timestamp: searched whole, the window was not applied.
files_searchedNo
files_unreadableNoOpened with an error — not proof the text is absent.
Behavior5/5

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

Annotations only supply readOnlyHint, so the description carries the behavioral burden. It discloses empty-answer semantics ('An empty answer means no match, never a failed search'), that unreadable files are 'listed apart', and the two-stage time-window filtering behavior. This is meaningful context beyond structured fields and does not contradict annotations.

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?

Four sentences, front-loaded with the operation and return shape, then caveats, then sibling routing. Every sentence carries distinct information; only 'which is what lets a year of logs finish' is slightly ornamental, but it does not hurt clarity.

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

Completeness5/5

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

With a 100%-covered schema and an output schema present, the description adds exactly the missing decision-level context: no-match vs failed-search, unreadable-file handling, time-window mechanics, and the cheaper tail alternative. Nothing essential is missing for correct invocation.

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 the baseline is 3. The description reinforces namesOnly and since semantics ('paths alone when line bodies are not wanted', 'a time window first skips files...') but does not add parameter-level meaning beyond the already rich input schema.

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 first sentence states a specific verb ('Greps'), a resource ('log files on the server'), and the two return modes (matching lines with paths, or paths alone). This is easily distinguishable from ssh_log_tail and the other siblings.

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?

Ends with an explicit routing rule: 'For the tail of a file, ssh_log_tail is cheaper.' It clearly implies this tool is for searching log content across files, giving an agent a concrete decision point against the most relevant sibling.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hypnosis/ssh-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server