Skip to main content
Glama

search_content

Read-only

Search large files for text patterns without loading full content. Find functions, errors, or log entries with support for fuzzy, regex, and case-insensitive matching.

Instructions

Search large files for text patterns without loading entire content into memory.

Use when finding functions, classes, errors, log entries, or counting
occurrences. Supports: fuzzy matching (handles typos/whitespace), regex
patterns, case-insensitive search, inverted matching (like grep -v), and
count-only mode. Returns ranked matches with line numbers and context
(lines truncated to 500 chars). When count_only=True, returns
{count, pattern, fuzzy_enabled, regex_enabled, case_sensitive, inverted}
instead of the full results structure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
absolute_file_pathYesAbsolute path to target file
patternYesText pattern to find (e.g., 'class User', 'ERROR', or regex like r'\d{3}-\d{4}')
max_resultsNoMaximum results to return (1-100)
context_linesNoLines of context before/after each match
fuzzyNoEnable fuzzy matching to handle typos and whitespace differences (default: true)
regexNoEnable regex pattern matching (e.g., r'error.*timeout'). Disables fuzzy matching.
case_sensitiveNoMatch exact case when true (default: false for case-insensitive)
invertNoReturn lines that do NOT match the pattern (like grep -v)
count_onlyNoReturn only the match count, not content. Efficient for large files.
Behavior5/5

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

Describes memory-efficient behavior, supports fuzzy/regex/inverted/count-only modes, mentions truncation of lines to 500 chars, and details the count-only return structure. Adds significant value beyond annotations (readOnlyHint, destructiveHint). No contradictions.

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?

Two-paragraph structure is efficient and front-loaded. First paragraph defines purpose and use cases; second paragraph details features and return behavior. Every sentence provides value, no fluff.

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 9 parameters (all described in schema) and no output schema, the description covers return format with ranking, line numbers, context, truncation, and the count-only structure. Complete for the tool's complexity.

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?

All 9 parameters have descriptions in the input schema (100% coverage). The description adds context by summarizing key options (fuzzy by default, regex disables fuzzy) and explaining the special behavior of count_only. Provides meaningful guidance beyond 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?

Clearly states the tool searches large files for text patterns without loading entire content into memory. Lists specific use cases (functions, classes, errors, log entries) and differentiates from sibling tools like search_directory.

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?

Explicitly says when to use: 'Use when finding functions, classes, errors, log entries, or counting occurrences.' Provides clear context but doesn't explicitly state when not to use, though sibling names imply alternatives.

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/peteretelej/largefile'

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