Skip to main content
Glama

search_text

Search for a substring within Microsoft Office documents (Word, Excel, PowerPoint) and return match locations with surrounding context. Supports case-sensitive and case-insensitive searches.

Instructions

Search for a substring across the body of an Office file.

The location format depends on the source file's extension:

  • .docx"paragraph:N" (0-based body paragraph index)

  • .xlsx"cell:<coord>" (e.g. "cell:B3")

  • .pptx"slide:N:shape:M" (0-based slide + 0-based shape index in slide.shapes)

Each match entry has a location and a context field. The context is a window of up to ~30 characters on each side of the match in the original text (case preserved).

Args: path: Path to the file to search. query: Substring to look for. Must be a non-empty string. case_sensitive: When True (default), the match is exact; when False, matches are case-insensitive. folder: Optional base folder for relative paths.

Returns: A list of match dicts. Empty when there are no matches (VAL-GEN-016).

Raises: OfficeMCPError: ERR_INVALID_PARAMS if query is not a string or is empty, ERR_FILE_NOT_FOUND if the file is missing, ERR_UNSUPPORTED_FMT for non-Office files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
queryYes
case_sensitiveNo
folderNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description fully discloses behavior: it details the match output (location and context with window size), error types, and parameter effects. This is thorough and compensates for missing annotations.

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 bullet points for location formats and clear sections for args/returns/raises. It is relatively long but each part adds value; minor trimming could improve conciseness.

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 the tool's complexity (4 params, no annotations, output schema), the description is remarkably complete: it covers return format, error handling, parameter details, and usage context for multiple file types. No significant gaps.

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%, but the description adds rich semantics for all four parameters: explains path, query (non-empty string), case_sensitive (default true, case-insensitive when false), and folder (optional base path). This goes well 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 the tool searches for a substring across the body of Office files (docx, xlsx, pptx) with specific location formats per file type. It is distinct from siblings like word_find_replace (Word-only) and covers multiple file types.

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 provides detailed context on location formats, parameter behavior, and error conditions. However, it does not explicitly compare to alternative tools or state when not to use this tool, which would strengthen guidance.

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/gawirable/office-mcp'

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