codemap_find_by_name

Find files by name pattern. Supports wildcards (*, ?).

searchpatternwildcard

Parameters

NameTypeRequiredDescription
patternstring✅ RequiredFile name pattern with wildcards (* for any characters, ? for single character)

Usage Examples

MCP Usage (for AI Agents like Claude)

json
{
  "name": "codemap_find_by_name",
  "arguments": {
    "pattern": "*.ts"
  }
}

Example Output

JSON Response

json
{
  "success": true,
  "files": [
    "src/utils/helpers.ts",
    "src/api/client.ts",
    "src/types/common.ts",
    "src/features/dashboard.ts"
  ],
  "count": 4
}
ℹ️When to Use This Tool
  • Find files by extension or pattern
  • Locate components, tests, configs
  • Quick file discovery by naming convention
  • Validate file presence
  • Audit file types in project
💡Common Patterns
Find by Extension
const ts = await codemap.search.findByName('*.ts');
const vue = await codemap.search.findByName('*.vue');


Find by Suffix
const tests = await codemap.search.findByName('*.test.ts');
const components = await codemap.search.findByName('*Component.vue');


Find Specific File
const config = await codemap.search.findByName('tsconfig.json');
💡Pro Tips
Use wildcards strategically - * matches any characters, ? matches single character
Combine with filters - Use results as input to other search operations
Pattern syntax - Supports glob patterns like *.{ts,js} for multiple extensions
Best Practices
Start broad - Use *.ts then filter, rather than complex patterns
Check count - Verify expected number of matches
Use for validation - Ensure required files exist
⚠️Common Mistakes
Mistake: Forgetting wildcard
await codemap.search.findByName('Component.vue'); // Only finds exact match

Instead: Use wildcard
await codemap.search.findByName('*Component.vue'); // Finds all components