Skip to main content
Glama

Search Files

localnest_search_files
Read-onlyIdempotent

Search file paths and names to quickly locate modules, features, or components by name in your codebase, enabling faster module discovery than content search.

Instructions

Search file paths and names matching a query. Use this first when looking for a module, feature, or component by name (e.g. "sso", "payment", "auth"). Much faster than content search for module discovery, and handles cases where the keyword only appears in file/directory names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
project_pathNo
all_rootsNo
max_resultsNo
case_sensitiveNo
response_formatNojson

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
metaNo

Implementation Reference

  • The handler implementation for the 'localnest_search_files' tool, which uses the search.searchFiles service to perform the search and includes handling for "search miss" scenarios.
    registerJsonTool(
      'localnest_search_files',
      {
        title: 'Search Files',
        description: 'Search file paths and names matching a query. Use this first when looking for a module, feature, or component by name (e.g. "sso", "payment", "auth"). Much faster than content search for module discovery, and handles cases where the keyword only appears in file/directory names.',
        inputSchema: {
          query: z.string().min(1),
          project_path: z.string().optional(),
          all_roots: z.boolean().default(false),
          max_results: z.number().int().min(1).max(1000).default(defaultMaxResults),
          case_sensitive: z.boolean().default(false)
        },
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false
        }
      },
      async ({ query, project_path, all_roots, max_results, case_sensitive }) => {
        const results = search.searchFiles({
          query,
          projectPath: project_path,
          allRoots: all_roots,
          maxResults: max_results,
          caseSensitive: case_sensitive
        });
        if (results.length > 0) return results;
    
        return withSearchMissResponse(
          results,
          buildSearchMeta({
            tool: 'localnest_search_files',
            query,
            project_path,
            all_roots,
            max_results,
            case_sensitive
          }),
          'No file-path matches found.',
          [
            'Verify project_path or broaden the query to a path fragment.',
            'Try synonyms or module names instead of full phrases.'
          ],
          'Retry localnest_search_files with a broader path fragment or switch to localnest_search_code for an exact symbol.'
        );
      }
    );
Behavior3/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true. The description adds valuable behavioral context: performance characteristic ('Much faster than content search') and scope constraint ('handles cases where the keyword only appears in file/directory names'), but does not address potential rate limits or result set boundaries beyond the schema default.

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 tightly constructed sentences with zero waste. Front-loaded with core action, followed by usage guidance with concrete examples ('sso', 'payment', 'auth'), and concludes with comparative performance note. Every sentence earns its place.

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

Completeness3/5

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

Given the existence of an output schema, the description appropriately focuses on invocation logic and behavioral traits. However, with 6 parameters and 0% schema coverage, the lack of parameter semantics in the description leaves significant documentation gaps, particularly for 'project_path' and 'all_roots' which affect search scope.

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

Parameters2/5

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

Schema description coverage is 0%, requiring the description to compensate. It only implicitly references the 'query' parameter ('matching a query') but provides no guidance on 'project_path', 'all_roots', or other optional parameters that control search scope and output formatting.

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 provides a specific verb ('Search') and resource ('file paths and names'), and explicitly distinguishes from siblings by contrasting with 'content search' and noting it handles 'cases where the keyword only appears in file/directory names.'

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?

Provides explicit guidance ('Use this first when looking for a module, feature, or component by name') and contrasts performance with 'content search' (implying when to use the alternative). Lacks explicit naming of the sibling tool (localnest_search_code) or explicit 'when not to use' statement.

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/wmt-mobile/localnest'

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