Skip to main content
Glama
codingthefuturewithai

Code Understanding MCP Server

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

TableJSON Schema
NameRequiredDescriptionDefault
filesNo
branchNo
repo_pathYes
max_tokensNo
directoriesNo
cache_strategyNoshared
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description fully covers behavioral aspects. It explains that the tool is asynchronous (returns 'building' status), requires prior cloning, and describes the response format including edge cases like errors. This goes beyond basic input/output expectations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is somewhat lengthy but well-structured with Args, Returns, and Notes sections. Every sentence adds value, and the front-loaded purpose is clear. Minor truncation could be done without losing meaning, but current structure aids readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (6 params, no output schema, asynchronous behavior), the description is remarkably complete. It covers parameter semantics, return format with all fields, and critical notes about prerequisites and background processing. No gaps are evident.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description documents all 6 parameters with detailed explanations (e.g., 'files' optional, 'cache_strategy' defaults to 'shared'). This fully compensates for the lack of schema descriptions, adding significant meaning beyond the schema itself.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it retrieves a 'semantic analysis map' of the repository's code structure, including file hierarchy and code elements. This distinctively separates it from siblings like 'get_repo_structure' (which likely returns only file structure) and 'get_repo_file_content' (which returns file content).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly requires the repository to be cloned via 'clone_repo' and provides guidance on using 'max_tokens' or specific files/directories for large repos. It could be improved by explicitly stating when not to use this tool (e.g., if only file structure is needed, use 'get_repo_structure').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/codingthefuturewithai/mcp-code-understanding'

If you have feedback or need assistance with the MCP directory API, please join our Discord server