Skip to main content
Glama
AtefAndrus

@atef_andrus/mcp-ripgrep

by AtefAndrus

Ripgrep Search Count

search-count

Count how many times a regex pattern appears in each file. Returns file paths with match totals to analyze code or text distribution.

Instructions

Count pattern matches per file using ripgrep. Returns file paths with their match counts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
globNoGlob pattern to filter files
pathYesDirectory or file to search
sortByNoSort results: 'path' (alphabetical), 'count' (descending), 'count-asc' (ascending)
patternYesSearch pattern (regex by default)
fileTypeNoFilter by file type (e.g. 'ts', 'py')
maxDepthNoMaximum directory traversal depth
noIgnoreNoDo NOT respect .gitignore rules (search files that are normally ignored)
countModeNo'lines' counts matching lines (default), 'matches' counts all matches including multiple per line
wordMatchNoOnly match whole words
fileTypeNotNoExclude file type
includeZeroNoInclude files with zero matches in the output
fixedStringsNoTreat pattern as a literal string
caseSensitiveNotrue = case-sensitive, false = case-insensitive, omit = smart-case
includeHiddenNoInclude hidden files and directories
maxCharactersNoMaximum characters in the result. Truncated with summary if exceeded.
followSymlinksNoFollow symbolic links

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It usefully discloses the return format (paths + counts), but says nothing about read-only safety, truncation behavior (despite a maxCharacters param), or performance characteristics of a recursive ripgrep count.

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, zero waste, and the core action plus return value are front-loaded. Nothing needs trimming.

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 annotations and no output schema, the description covers purpose and return shape adequately, and the rich schema compensates for parameter details. Only the absence of usage routing and truncation/pagination notes keeps it from being fully complete.

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 schema already documents all 16 parameters in detail. The description adds no syntax, default, or interaction details beyond that, which is the baseline 3 when the schema does the heavy lifting.

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+resource ('count pattern matches per file using ripgrep') and even describes the return shape (file paths with match counts). It implicitly separates itself from the sibling 'search' (which presumably returns matches rather than counts), but it never explicitly names an alternative.

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

Usage Guidelines2/5

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

No when-to-use, when-not-to-use, or alternative-tool guidance at all. An agent must infer from the sibling names ('search', 'search-files') whether counting is preferable to listing matches.

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