codemap_get_symbols

Get all symbols (functions, classes, interfaces, etc.) in a file. Supports symbol targeting (relativePath$symbolName) to get nested symbols — e.g. passing a class name returns only its methods, excluding top-level file symbols.

iosymbolsreadinspectsymbol-targeting

Parameters

NameTypeRequiredDescription
targetstring✅ RequiredRelative path to the file, or symbol reference (relativePath$symbolName) to get nested symbols within that class or interface
kindstring❌ OptionalFilter results by symbol kind: function|class|interface|const|type|enum|variable|method|property

Usage Examples

MCP Usage (for AI Agents like Claude)

json
{
  "name": "codemap_get_symbols",
  "arguments": {
    "target": "src/utils/helper.ts"
  }
}

Example Output

JSON Response

json
{
  "success": true,
  "data": {
    "file": "src/utils/helpers.ts",
    "symbols": [
      {
        "name": "formatDate",
        "kind": "function",
        "line": 3
      },
      {
        "name": "parseJSON",
        "kind": "function",
        "line": 10
      },
      {
        "name": "Config",
        "kind": "interface",
        "line": 20
      }
    ],
    "symbolCount": 3
  }
}
ℹ️When to Use This Tool
    Use codemap_get_symbols when you need to:
  • List all exports in a module
  • Find all functions or classes in a file
  • Generate API documentation
  • Analyze code structure programmatically
💡Common Patterns
Symbol Inventory
1. Get all symbols
2. Group by kind
3. Generate report


API Documentation
1. Get symbols with kind=function
2. For each: read symbol details
3. Generate docs
💡Pro Tips
  • Use kind filter for focused results: Specify kind when you only need specific symbol types
  • Combine with read for details: get-symbols gives you names/lines, use read to get implementation
  • Check line numbers: Use line numbers to navigate directly to symbol definitions
Best Practices
  • Filter by kind when possible for faster results
  • Use with peek for complete file overview
  • Combine with read for full symbol implementation
  • Cache results for repeated analysis
⚠️Common Mistakes
Mistake: Not filtering by kind when you only need specific types
Instead: Use kind parameter to get only what you need

Mistake: Expecting symbol implementation in results
Instead: Use read tool to get actual code, get-symbols only lists names/locations

Mistake: Using get-symbols when peek would suffice
Instead: Use peek with symbols:true for overview including other metadata

Related Tools