Skip to main content
Glama

search

Locate lines in markdown files by case-insensitive substring query. Retrieves file path, line number, snippet, and heading context, with configurable recursion and maximum results.

Instructions

Case-insensitive full-text substring search across MARKDOWN docs (for code symbol definitions use find). Returns matches {path, line, snippet (≤200 chars), inHeading}, heading matches ranked first, capped at max_results (default 50, max 200) with totalMatches and truncated:true when capped. Empty/whitespace queries are rejected (they would match everything). Locate the right doc, then outline/heading to read it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dirNoDirectory to search, relative to the working directory (default: the working directory).
queryYesSearch term — case-insensitive substring, matched per line. Must be non-empty.
recursiveNoRecurse into subdirectories (default: true).
max_resultsNoMax matches (default 50, clamped to 1–200).
Behavior5/5

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

Without annotations, the description fully discloses behavior: case-insensitive substring matching, ranking (heading matches first), result structure (path, line, snippet ≤200 chars, inHeading), capping with totalMatches and truncated flag, and rejection of empty/whitespace queries. This provides comprehensive transparency.

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 concise (three sentences) and front-loaded: first sentence defines purpose and contrast, second details behavior, third gives usage hint. Every sentence adds unique value without redundancy.

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 parameters, 1 required, no output schema), the description covers purpose, usage, return format, constraints, and alternatives. It provides sufficient completeness for an agent to select and invoke the tool correctly.

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

Parameters4/5

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

Schema coverage is 100%, but the description adds meaningful context beyond the schema: it explains the default (50) and maximum (200) for max_results, and emphasizes that query must be non-empty. This enriches the parameter semantics.

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 it is a case-insensitive full-text substring search across MARKDOWN docs, and explicitly distinguishes itself from the sibling 'find' tool for code symbol definitions. The verb ('search') and resource ('MARKDOWN docs') are specific and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear guidance: contrast with 'find' for code symbols, and advises to 'locate the right doc, then outline/heading to read it.' It also warns that empty/whitespace queries are rejected, preventing misuse.

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/segentic-lab/lens-mcp'

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