Skip to main content
Glama
TMYTiMidlY

portal-mcp-server

by TMYTiMidlY

portal_grep

Search file contents on a remote host using regex patterns. Returns structured JSON with capped results and supports pagination, globs, and file type filters.

Instructions

Search file contents with a regex on a remote host (ripgrep, fallback grep). Prefer this over running raw rg/grep through portal_exec — it returns structured JSON and caps output so a broad search can't blow up your context. Pair it with portal_glob to find files by name.

Args: host: SSH host alias / registered name. pattern: the regex to search for (rg/PCRE-ish syntax). path: file or directory to search under (default: cwd "."). Result paths are returned relative to it. glob: filter files by a glob, e.g. ".py" or "!.test.ts". file_type: rg --type filter, e.g. "py", "rust", "js". output_mode: - "files_with_matches" (default): just the matching file paths, NEWEST FIRST. Cheapest; use it to locate, then re-grep with output_mode="content" on the file you care about. - "content": matching lines as {file, line, text} (context lines carry "context": true). head_limit caps the TOTAL lines returned and offset pages through them. - "count": per-file match counts + a grand total. ignore_case: case-insensitive match. before_context / after_context / context: lines of context to include around each match in "content" mode (context = both sides). head_limit: cap on results (files / content lines / count rows). Default 250; a truncated flag in the result tells you more were dropped. offset: skip the first offset results (pagination). multiline: let . and the pattern span line boundaries.

Respects .gitignore (ripgrep's default). Returns JSON whose shape depends on output_mode; every shape includes a truncated flag.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
globNo
hostYes
pathNo.
offsetNo
contextNo
patternYes
file_typeNo
multilineNo
head_limitNo
ignore_caseNo
output_modeNofiles_with_matches
after_contextNo
before_contextNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description carries full burden. It discloses that output is structured JSON, that results are capped to avoid context overflow, that .gitignore is respected, and that a truncated flag indicates dropped results. It also explains the meaning of each output mode, how pagination with head_limit and offset works, and that result paths are relative to the path argument. This is comprehensive behavioral disclosure.

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

Conciseness4/5

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

The description is well-structured: a clear introductory paragraph followed by parameter-focused lines. It front-loads the key advice about preferring over portal_exec and pairing with portal_glob. While comprehensive, it could be slightly more concise (e.g., merging some parameter explanations). However, every sentence serves a purpose, and the length is justified by the tool's complexity.

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?

Given 13 parameters, no annotations, and an existing output schema, the description covers everything needed: behavioral traits, semantics, usage guidance, and output shape explanation. It mentions the truncated flag and that output shape depends on output_mode, which complements the output schema. The tool is complex, but the description leaves no major gaps for an agent to misunderstand.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate. It does so excellently: for every parameter it explains purpose, default behavior, and edge cases. For output_mode, it details the three modes and their outputs, including the order (newest first for files_with_matches). It explains head_limit's default and the truncated flag, and how offset enables paging. Context parameters are clarified. This adds significant value beyond the 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 description clearly states it searches file contents with a regex on a remote host using ripgrep, with a fallback to grep. It distinguishes itself from sibling tools like portal_exec and portal_glob by explicitly recommending it over raw rg/grep and pairing with portal_glob for name-based search. The verb 'search', resource 'file contents', and context 'on a remote host' are specific and unambiguous.

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?

The description explicitly says 'Prefer this over running raw rg/grep through portal_exec' and 'Pair it with portal_glob to find files by name'. This provides clear when-to-use and when-not-to-use guidance, and suggests alternatives. It also implies using the tool for content search and portal_glob for name search, which helps an agent choose correctly.

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/TMYTiMidlY/portal-mcp-server'

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