Skip to main content
Glama
StepanCooleague

file-finder-mcp

search-files

Search for files in your filesystem using path fragments to locate documents quickly. Specify a directory and query to find files by name or path, returning metadata like size and creation date.

Instructions

Поиск файлов по фрагменту пути

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesФрагмент пути для поиска
directoryNoКаталог для поиска/

Implementation Reference

  • Handler for tool calls; specifically handles 'search-files' by extracting arguments and calling search_files function.
    @server.call_tool()
    async def handle_call_tool(
        name: str, arguments: dict | None
    ) -> list[types.TextContent]:
        """
        Обрабатывает выполнение инструментов.
        """
        if name != "search-files":
            raise ValueError(f"Неизвестный инструмент: {name}")
    
        if not arguments or "query" not in arguments:
            raise ValueError("Отсутствует обязательный параметр 'query'")
    
        query = arguments["query"]
        directory = arguments.get("directory", "/")
    
        result = search_files(query, directory)
    
        return [
            types.TextContent(
                type="text",
                text=result,
            )
        ]
  • Input schema definition for the 'search-files' tool.
    inputSchema={
        "type": "object",
        "properties": {
            "query": {"type": "string", "description": "Фрагмент пути для поиска"},
            "directory": {"type": "string", "description": "Каталог для поиска", "default": "/"},
        },
        "required": ["query"],
    },
  • Tool registration in the list_tools response, including name, description, and schema.
    types.Tool(
        name="search-files",
        description="Поиск файлов по фрагменту пути",
        inputSchema={
            "type": "object",
            "properties": {
                "query": {"type": "string", "description": "Фрагмент пути для поиска"},
                "directory": {"type": "string", "description": "Каталог для поиска", "default": "/"},
            },
            "required": ["query"],
        },
    )
  • Helper function that performs the actual file search using os.walk, collects file stats, and returns JSON string.
    def search_files(query: str, directory: str) -> str:
        """
        Выполняет поиск файлов в заданном каталоге.
        Возвращает результат в формате JSON.
        """
        matches = []
    
        for root, _, files in os.walk(directory):
            for file in files:
                if query in file:
                    file_path = os.path.join(root, file)
                    try:
                        stats = os.stat(file_path)
                        matches.append({
                            "name": file,
                            "path": file_path,
                            "size": stats.st_size,
                            "created": datetime.fromtimestamp(stats.st_ctime).isoformat(),
                        })
                    except Exception:
                        continue
    
        return json.dumps({"files": matches}, indent=2)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states what the tool does (searching) but lacks critical details such as search scope (e.g., recursive vs. shallow), performance implications, error handling, or output format. This leaves significant gaps in understanding the tool's behavior.

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?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized for a simple tool, though it could be slightly more structured by including key behavioral details to improve clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It fails to address important contextual aspects like what the search returns (e.g., file paths, metadata), how results are formatted, or any limitations (e.g., case sensitivity, supported file systems). This leaves the agent with insufficient information for reliable use.

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?

The schema description coverage is 100%, meaning the input schema fully documents both parameters. The description does not add any additional meaning or context beyond what the schema provides, such as examples or edge cases, so it meets the baseline score of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Поиск файлов по фрагменту пути' clearly states the purpose: searching files by path fragment. It specifies the verb (search) and resource (files), but since there are no sibling tools, it cannot demonstrate differentiation from alternatives, which is required for a score of 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or limitations. It merely restates the basic functionality without contextual usage instructions, which is insufficient for effective tool selection.

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/StepanCooleague/file-finder-mcp'

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