codemap_find_by_name
Find files by name pattern. Supports wildcards (*, ?).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
pattern | string | ✅ Required | File 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
Find by Suffix
Find Specific File
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 -
Combine with filters - Use results as input to other search operations
Pattern syntax - Supports glob patterns like
* matches any characters, ? matches single characterCombine with filters - Use results as input to other search operations
Pattern syntax - Supports glob patterns like
*.{ts,js} for multiple extensionsBest Practices
Start broad - Use
Check count - Verify expected number of matches
Use for validation - Ensure required files exist
*.ts then filter, rather than complex patternsCheck count - Verify expected number of matches
Use for validation - Ensure required files exist
Common Mistakes
❌ Mistake: Forgetting wildcard
✅ Instead: Use wildcard
await codemap.search.findByName('Component.vue'); // Only finds exact match✅ Instead: Use wildcard
await codemap.search.findByName('*Component.vue'); // Finds all components