Skip to main content
Glama

search_document

Search for text within a Word document and retrieve matching paragraphs with surrounding context. Avoid loading the entire file by pinpointing content directly.

Instructions

Search for text in a Word document.

Use this to find specific content without loading the entire document. Returns matching paragraphs with surrounding context.

Args: path: Path to the .docx file query: Text to search for case_sensitive: Match case exactly (default: False) context_paragraphs: Paragraphs to include before/after each match (default: 1) max_results: Maximum matches to return (default: 20) include_annotations: Include comments/track changes on matched paragraphs (default: False)

Returns: Dictionary containing: - query: The search query - case_sensitive: Whether search was case-sensitive - total_matches: Total matches found - matches_returned: Number returned (may be limited) - matches: List with paragraph_index, paragraph_text, paragraph_style, match_start, match_end, context_before, context_after, and optionally comments and track_changes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
queryYes
max_resultsNo
case_sensitiveNo
context_paragraphsNo
include_annotationsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description fully covers behavioral details: it returns matching paragraphs with surrounding context, limits results via 'max_results', and optionally includes annotations. The return structure is thoroughly described, including fields like 'match_start', 'match_end', and 'context_before'.

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 with a summary, usage hint, parameter list, and return explanation. It is efficient but slightly verbose; for example, the 'Args' and 'Returns' sections could be condensed without losing clarity.

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?

The description is self-contained and complete for a search tool. It covers purpose, parameters, behavior, and return format, leaving no ambiguity about what the tool does or how to use it.

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?

The input schema has 0% description coverage, but the 'Args' section in the description clearly explains each parameter, including defaults and effects. The return value is also detailed, compensating fully for the schema's lack of descriptions.

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 starts with 'Search for text in a Word document,' which clearly states the verb and resource. It distinguishes the tool from siblings like 'read_document' by emphasizing that it finds specific content without loading the entire document.

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?

The description advises using the tool to 'find specific content without loading the entire document,' implying it is not for full-document reading. However, it does not explicitly name alternative tools like 'read_document' for when the entire document is needed.

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/kosh-jelly/docx-comments-mcp'

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