Skip to main content
Glama

grep

Read-only

Search DOCX documents using regex patterns to find specific paragraphs or content in Word files and Google Docs.

Instructions

Search paragraphs with regex. Use file_path for session-based search, file_paths for stateless multi-file search, or google_doc_id for Google Docs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathNoPath to the DOCX file.
google_doc_idNoGoogle Doc ID or URL (alternative to file_path). Extract from URL: docs.google.com/document/d/{ID}/edit
file_pathsNoMultiple file paths for stateless multi-file search. No session created.
patternsNo
patternNo
case_sensitiveNo
whole_wordNo
max_resultsNo
context_charsNo
dedupe_by_paragraphNo
search_xmlNoWhen true, search raw XML (word/document.xml) instead of paragraph text.
include_contextNoWhen false, skip document view context (list labels, headers) for faster results. Default: true.
Behavior3/5

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

Annotations already declare readOnlyHint=true. The description adds valuable context distinguishing 'session-based' from 'stateless' search modes. However, with no output schema provided, the description fails to disclose what the tool returns (match objects, paragraph text, offsets?) or how regex syntax should be formatted.

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?

The description is optimally concise at two sentences. It front-loads the primary action and immediately follows with usage guidance. Every word earns its place with zero redundancy or filler.

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

Completeness2/5

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

Given the tool's complexity—12 parameters, multiple input sources, regex support, and no output schema—the description is insufficient. It omits return value documentation, regex syntax requirements, and guidance on 7 undocumented parameters, leaving significant gaps for agent operation.

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

Parameters2/5

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

With only 42% schema description coverage, the description fails to compensate adequately for undocumented parameters. While it clarifies the three file input options, it completely ignores the critical search parameters ('pattern' vs 'patterns' array), boolean flags (whole_word, dedupe_by_paragraph), and result limiters (max_results, context_chars), leaving agents guessing at their semantics.

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?

The description clearly states the core function ('Search paragraphs with regex') with a specific verb and resource. However, it does not explicitly differentiate this tool from the sibling 'read_file' tool, which also retrieves document content but likely without regex filtering.

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?

The description provides explicit guidance on choosing between the three mutually exclusive input methods ('Use file_path for session-based search, file_paths for stateless...'). However, it lacks guidance on when to use this tool versus 'read_file' or 'replace_text', and does not clarify the difference between 'pattern' and 'parameters' parameters.

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/UseJunior/safe-docx'

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