Skip to main content
Glama

search_file_contents

Read-only

Find files by matching text inside them across PDF, Office, and plain text formats. Returns a snippet around the first match and its PDF page for quick verification.

Instructions

Search files by the text inside them (PDF, Word/Excel/PowerPoint, OpenDocument, plain text and code). Matches a literal substring, case-insensitive; returns a snippet around the first match and its PDF page. Scanned images are not searchable.

Input Schema

NameRequiredDescriptionDefault
queryYeswords or a phrase that appears in the file content; at least two CJK characters or three letters
cursorNonext_cursor from the previous page

Output Schema

NameRequiredDescriptionDefault
itemsYes
next_cursorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

readOnlyHint=true already declares the safety profile, yet the description still adds real behavioral detail: matching is literal and case-insensitive (no regex or fuzzy behavior), only a snippet around the FIRST match is returned, and the PDF page accompanies it. The scanned/OCR exclusion is a concrete capability boundary. It does not mention result caps or how many files are scanned, which is the remaining gap.

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?

Three short sentences, front-loaded with the core verb and resource, followed by matching semantics and then the exclusion. Nothing is redundant or padded.

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

Completeness3/5

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

The output schema covers the return shape, and the description explains match behavior, so the essentials are present for a 2-parameter tool. It never states the search scope (all files across the drive vs. a folder), result-count limits, or whether paging is expected, which an agent would want before calling.

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 coverage is 100%, so both parameters are already documented (query with a minimum-length rule, cursor with next_cursor semantics). The description's case-insensitive literal-substring note does inform how to craft the query, but it adds only modest meaning beyond the schema, so the baseline of 3 holds.

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 ('Search files by the text inside them') and enumerates supported formats (PDF, Office, OpenDocument, plain text, code), so it is clearly content search rather than name search. It stops short of naming siblings like search_files, read_text_file or read_document_text, leaving the boundary to be inferred.

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?

Usage is implied by the matching semantics ('literal substring, case-insensitive') and one explicit exclusion ('Scanned images are not searchable'), which helps an agent avoid a fruitless call. There is no statement of when to prefer this over read_document_text or search_files, and no prerequisites or limits guidance.

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