Skip to main content
Glama
ssh-remote-mcp
by wcbup

Search Remote File Contents

ssh_grep
Read-onlyIdempotent

Search text across remote files or a single file over SSH using regex or literal matching. Apply glob filters, case-insensitive matching, and match limits to pinpoint results.

Instructions

Search text across remote files or a single file using regex or literal matching. Excludes .git and node_modules; uses ripgrep (rg) on Unix when installed.

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": {
      "target": "<target>",
      "path": "<path>",
      "pattern": "<pattern>"
    },
    "name": "ssh_grep"
  }
}

Input Schema

NameRequiredDescriptionDefault
globNoOptional filename/path glob filter (e.g. '*.yaml', 'src/*.ts')
pathYesExplicit remote absolute path (e.g. /etc/nginx/nginx.conf or C:\Services\app.json) or home-relative ~/... path. Bare relative paths are rejected.
targetYesSSH target as configured host alias, host, user@host, user@host:port, or [ipv6]:port. Never include remote paths in target.
literalNoTreat pattern as a fixed literal string instead of regex (default: false)
patternYesRegex or literal search pattern
ignore_caseNoCase-insensitive search (default: false)
max_matchesNoMaximum matching lines to return (default: 100)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive and open-world, so the safety profile is covered. The description adds genuinely useful behavior: default exclusion of .git and node_modules, and reliance on ripgrep on Unix when installed, which hints at differing result semantics on systems without rg — but it never states what the fallback is or how truncation at max_matches behaves.

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 tight sentences: purpose first, then default exclusions and the ripgrep implementation note. Nothing is redundant and nothing is buried.

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 7-parameter read-only search tool with full schema coverage and no output schema, the description covers purpose, matching modes, scope (single file or many) and default ignore rules. It leaves result-format and truncation behavior unstated, but those are largely inferable from max_matches and grep conventions.

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 including glob, path and literal is already documented in structured form. The description's 'regex or literal matching' and 'single file vs across files' only restate what the schema conveys, adding no syntax or format detail beyond it; baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: searching text content across remote files or a single file, with regex or literal matching. That clearly separates it from file-name lookup (ssh_find) and whole-file retrieval (ssh_read) in spirit, though it never names those siblings explicitly.

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

Usage Guidelines3/5

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

Usage is only implied by the phrase 'search text across remote files or a single file' — an agent can infer this is the content-search tool. There is no explicit when-to-use/when-not-to-use guidance or pointer to an alternative for listing or reading files.

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