Skip to main content
Glama
schmosbyy
by schmosbyy

file_search

Find a literal string in a file or entire directory tree, then view each match with surrounding context lines for quick orientation.

Instructions

Search for a literal string pattern in a file or recursively in a directory. Returns structured hits with surrounding context lines. Case-insensitive. Replaces grep -n. For regex searches, use shell_exec.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to a file or directory. Tilde (~) is expanded to the home directory. Directories are searched recursively.
patternYesSearch string. Treated as a case-insensitive literal (not regex).
max_resultsNoStop after this many total matches. Default 50, max 200.
context_linesNoNumber of lines to include before and after each match. Default 2, max 5.
include_patternNoDirectory mode only: only search files whose name ends with this string. Example: ".ts" for TypeScript files. Omit to search all files.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.2.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral disclosure burden. It discloses case-insensitivity, literal (non-regex) matching, recursive directory behavior, and return of structured hits with context lines. It could mention stop-after-max behavior or permissions, but the disclosed traits cover the core operation well.

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 sentences with no fluff. The primary action and scope are front-loaded, and each sentence adds distinct value: search behavior, return shape, case sensitivity, and alternative tool routing.

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?

For a moderately complex search tool with no output schema, it explains the result type ('structured hits with surrounding context lines') and all key selector behaviors. It is slightly vague about the exact output format and edge cases, but the combination of description and fully documented schema is adequate for correct invocation.

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 description coverage is 100%, so the schema already documents all five parameters thoroughly. The description adds behavioral context like case-insensitivity and literal matching, but it does not add substantial parameter-level meaning beyond what the schema provides.

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 uses a specific verb ('Search') and identifies the exact resource scope: a literal string in a file or recursively in a directory. It also distinguishes itself from shell_exec by explicitly punting regex searches to that sibling, so agents can disambiguate without reading schemas.

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?

It states when to use this tool ('Replaces grep -n') and explicitly names the alternative for a different case ('For regex searches, use shell_exec'). This gives clear selection criteria among the sibling tools.

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

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/schmosbyy/openclaw-mcp-termux'

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