get_source_repo_map
Retrieve a semantic map of a repository's code structure, including file hierarchy, functions, classes, and their relationships for AI-assisted code understanding.
Instructions
Retrieve a semantic analysis map of the repository's code structure.
Returns a detailed map of the repository's structure, including file hierarchy,
code elements (functions, classes, methods), and their relationships. Can analyze
specific files/directories or the entire repository.
Args:
repo_path (str): Path or URL matching what was originally provided to clone_repo
files (List[str], optional): Specific files to analyze. If None, analyzes all files
directories (List[str], optional): Specific directories to analyze. If None, analyzes all directories
max_tokens (int, optional): Limit total tokens in analysis. Useful for large repositories
branch (str, optional): Specific branch to analyze (only used with per-branch cache strategy)
cache_strategy (str, optional): Cache strategy - "shared" (default) or "per-branch"
Returns:
dict: Response with format:
{
"status": str, # "success", "building", "waiting", or "error"
"content": str, # Hierarchical representation of code structure
"metadata": { # Analysis metadata
"excluded_files_by_dir": dict,
"is_complete": bool,
"max_tokens": int
},
"message": str, # Present for "building"/"waiting" status
"error": str # Present for "error" status
}
Note:
- Repository must be previously cloned using clone_repo
- Initial analysis happens in background after clone
- Returns "building" status while analysis is in progress
- Content includes file structure, code elements, and their relationships
- For large repos, consider using max_tokens or targeting specific directories
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | No | ||
| branch | No | ||
| repo_path | Yes | ||
| max_tokens | No | ||
| directories | No | ||
| cache_strategy | No | shared |