get_repo_info
Retrieve details about the current code repository, including structure and metadata, to analyze codebases and understand system architecture.
Instructions
Get information about the currently initialized code repository.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- code_analysis.py:438-452 (handler)The main handler function for the 'get_repo_info' tool. It checks if a repository is initialized and returns basic information about it, including path, existence, directory status, and .gitignore presence. Registered via the @mcp.tool() decorator.
@mcp.tool() async def get_repo_info() -> str: """Get information about the currently initialized code repository.""" if not mcp.repo_path: return "No code repository has been initialized yet. Please use initialize_repository first." gitignore_path = mcp.repo_path / '.gitignore' gitignore_status = "Found .gitignore file" if gitignore_path.exists() else "No .gitignore file present" return f"""Code Repository Information: Path: {mcp.repo_path} Exists: {mcp.repo_path.exists()} Is Directory: {mcp.repo_path.is_dir()} {gitignore_status}"""