Skip to main content
Glama

search

Search files, directories, or URLs for text across PDFs, Office docs, EPUBs, HTML, and images. Returns each hit with file, page or slide, and a highlighted snippet.

Instructions

Search documents for text: one file, many files, whole directories (recursive, .gitignore aware), or URLs, across every format read supports. Returns each hit as file + page/slide/sheet + a snippet with the match in bold. mode auto (default) finds the exact phrase and falls back to BM25-ranked passages when there is none; literal or ranked force one. Narrow directories with glob, e.g. "*.pdf".

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "search"
  }
}

Input Schema

NameRequiredDescriptionDefault
globNoOnly search files matching this glob inside directories, e.g. "*.pdf" or "reports/**".
modeNoauto (default): exact phrase, falling back to ranked passages when nothing matches. literal: exact phrase only. ranked: BM25 over the query words.
queryYesText to find.
sourcesNoFiles, directories (searched recursively, .gitignore respected), or URLs. Default: the current directory.
whole_wordNo
max_resultsNoMaximum hits to return (default 20).
context_charsNoSnippet context characters on each side (default 80).
case_sensitiveNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.1

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does real work: it discloses the return shape (file + page/slide/sheet + snippet with the match bolded), recursive traversal with .gitignore respect, and the default behavior of auto mode falling back from literal to ranked when no exact phrase exists. It does not mention permissions, size/rate limits, or performance characteristics of scanning large trees, which keeps it below 5.

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?

Front-loaded with the capability and scope before any detail, and every sentence carries information about scope, return format, mode semantics, or narrowing. The mode sentence partially restates the mode parameter's schema description, so it is dense but not perfectly waste-free.

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?

No output schema exists, so the description usefully explains the hit format, and it covers the core semantics of query, sources, glob and mode. It is incomplete for an 8-parameter tool in that whole_word and case_sensitive go unmentioned, forcing the agent back to the schema to understand them.

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 75%, and the schema already documents query, glob, sources, mode, max_results and context_chars in detail, so the description adds only the mode fallback rationale on top. The two undocumented parameters (whole_word, case_sensitive) are never mentioned in the description, leaving the coverage gap unaddressed.

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?

Opens with a specific verb+resource ("Search documents for text") and immediately bounds the scope: single file, many files, recursive directories that respect .gitignore, or URLs. It also signals the relationship to the sibling `read` by saying it covers "every format read supports," so an agent can distinguish it from read/inspect/outline without opening schemas.

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?

Gives clear operative guidance: mode auto vs literal vs ranked is explained with the selection rule (exact phrase first, BM25 fallback), and glob is offered as the way to narrow directories. What is missing is explicit when-to-use/when-not framing against siblings such as `read` (e.g. use this instead of read when you don't know which file contains the text), so it lands at 4 rather than 5.

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

Deploy Server

Other Tools