Skip to main content
Glama

search_files

Read-only

Regex search across every text file in a project to find which files call a function or where a value is defined. Returns file, line number, matching line, grouped by file; reports truncation.

Instructions

Regex search across every text file in the project. Use this to answer 'which files call X?' or 'where is Y defined?' — it is one request regardless of project size, whereas list_files plus read_file per candidate is one round trip per file and pulls whole documents into context to find a few lines.

Returns file, line number and the matching line, grouped by file. Binary files are skipped. Results are capped and the cap is reported, so a truncated result is never mistaken for a complete one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextNoLines of surrounding context to include with each match (0-10). Default 0.
patternYesPython regular expression, matched per line. Remember to escape regex metacharacters when searching for literal text — e.g. '#io-table\\(' for a call.
path_globNoOptional glob to restrict which paths are searched, e.g. 'sections/**' or '*.typ'.
project_idYesTypleaf project ID — a 24-character lowercase hex string (e.g. '692a83fb82feceb233c4b0e7'), obtained from list_projects or the project URL. NOT a local filesystem path, NOT '.', NOT a project name or title. These tools operate on the REMOTE Typleaf project. Only call these tools when the user explicitly asks to work with a Typleaf project — never for general local file I/O. If you already have a copy of THIS project checked out on the local filesystem, prefer the standard read/grep tools against that path. Always call list_projects first when unsure.
ignore_caseNoCase-insensitive match. Default false.
max_resultsNoMaximum matches to return (default 200).
Behavior4/5

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

Annotations declare readOnlyHint=true, and the description adds behavior beyond that: it returns file/line/matching line grouped by file, skips binary files, and caps results with the cap reported. This prevents misinterpreting truncated results as complete, which is valuable operational context not present in the annotations.

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 compact paragraphs with zero filler. The first sentence states the tool's core function; the second justifies its superiority over an alternative; the third explains the return format and cap behavior. Everything earns its place and is front-loaded.

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?

For a read-only search tool with no output schema, the description discloses all necessary call-time knowledge: return format, grouping, binary skipping, and truncation reporting. Combined with the detailed project_id guidance in the schema, an agent has everything needed to invoke and interpret results correctly.

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?

All 6 parameters have full schema descriptions (100% coverage), so the description itself adds no parameter-level detail beyond what the schema already provides. The pattern escaping example and path_glob example live in the schema, not the description. Per the rubric, this is a baseline 3.

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 opens with a specific verb-resource pair ('Regex search across every text file in the project') and immediately names the two canonical use cases. It also distinguishes itself from the list_files + read_file alternative, making its unique role among siblings 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?

Explicitly states when to use ('which files call X?', 'where is Y defined?') and why it's preferable (one request vs. per-file round trips that pull whole documents). The project_id parameter description reinforces invocation rules (only for remote Typleaf projects, prefer local tools when a local copy exists, and list_projects first if unsure).

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/superzeldalink/typleaf-mcp'

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