Skip to main content
Glama
slepp
by slepp

ssh_grep

Search remote file contents over SSH using regex, returning matching files, lines with numbers and context, or counts, with optional glob filters.

Instructions

Search remote file contents over SSH — the remote counterpart of the local content-search tool. Backed by remote grep (PCRE-like -P when available, otherwise POSIX extended regex), recursing under 'path' while skipping .git/.hg/.svn. Defaults to 'files_with_matches' mode for efficiency; use 'content' mode for matching lines with line numbers and optional context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
globNoGlob filter for which filenames to search, e.g. '*.py' or '*.{ts,tsx}'.
pathNoRemote file or directory to search. Default: '.' (the SSH login directory).
portNo
targetYesOpenSSH target such as host, alias, or user@host.
contextNoLines of context before and after each match. Only applies to output_mode='content'.
patternYesRegular expression to search for.
timeoutNoLocal timeout in seconds.
head_limitNoCap the number of returned matches/files.
output_modeNo'content': matching lines with line numbers (supports context). 'files_with_matches': just the matching paths (default). 'count': per-file match counts (files with zero matches are omitted).
context_afterNoLines of context after each match. Overridden by 'context' if both are given.
identity_fileNo
context_beforeNoLines of context before each match. Overridden by 'context' if both are given.
extra_ssh_argsNoAdditional ssh(1) flags passed verbatim, e.g. ["-J", "jumphost"]. Prefer the dedicated port, identity_file, and strict_host_key_checking parameters.
case_insensitiveNoCase-insensitive search. Default: false.
known_hosts_fileNo
strict_host_key_checkingNoBoolean or one of yes, no, ask, accept-new, off.
Behavior4/5

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

With no annotations, the description carries the burden of behavioral disclosure. It reveals regex flavor (PCRE-like -P fallback to POSIX ERE), directory skipping (.git/.hg/.svn), and default output mode. This adds meaningful context beyond the schema, though it omits details like SSH authentication behavior or error handling.

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, tightly packed with essential information. Front-loaded with purpose, then key behavioral traits. No filler or redundancy; every clause earns its place.

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 16-parameter tool with no output schema and no annotations, the description covers the core behavior well: purpose, regex variant, recursion behavior, and output modes. It does not elaborate on SSH-specific parameters like identity_file or strict_host_key_checking, but those are adequately described in the schema and are secondary to the tool's core function.

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

Parameters4/5

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

Schema coverage is 81%, so the baseline is 3. The description goes beyond the schema by explaining regex semantics (PCRE vs POSIX), the meaning of 'path' recursion and skipped directories, and the default output mode. These details help the agent understand parameter behavior more deeply.

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 clearly states the tool's function: 'Search remote file contents over SSH'. It distinguishes itself as 'the remote counterpart of the local content-search tool', making its role unambiguous and differentiating it from sibling tools like ssh_glob.

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?

Provides clear context that this is the remote search counterpart, implying use when remote content search is needed. Offers in-tool guidance about defaulting to files_with_matches for efficiency and using content mode for line details. However, it does not explicitly exclude alternatives or mention when not to use this tool.

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/slepp/ssh-mcp'

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