Skip to main content
Glama
codingthefuturewithai

Code Understanding MCP Server

get_repo_critical_files

Identify structurally significant files in a codebase by analyzing code complexity metrics, calculating importance scores to reveal critical files for understanding system structure.

Instructions

    Analyze and identify the most structurally significant files in a codebase.

    Uses code complexity metrics to calculate importance scores, helping identify
    files that are most critical for understanding the system's structure.

    Args:
        repo_path: Path/URL matching what was provided to clone_repo
        files: Optional list of specific files to analyze
        directories: Optional list of specific directories to analyze
        limit: Maximum number of files to return (default: 50)
        include_metrics: Include detailed metrics in response (default: True)

    Returns:
        dict: {
            "status": str,  # "success", "error"
            "files": [{
                "path": str,
                "importance_score": float,
                "metrics": {  # Only if include_metrics=True
                    "total_ccn": int,
                    "max_ccn": int,
                    "function_count": int,
                    "nloc": int
                }
            }],
            "total_files_analyzed": int
        }
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesNo
limitNo
branchNo
repo_pathYes
directoriesNo
cache_strategyNoshared
include_metricsNo
Behavior3/5

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

With no annotations, the description carries full burden. It explains that the tool uses complexity metrics and returns importance scores, but does not explicitly state it is read-only or disclose any side effects, prerequisites (beyond repo_path matching clone_repo), or error handling.

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 well-structured with a clear purpose sentence, a 'Uses...' sentence, and separate Args/Returns sections. It is not overly verbose, though the Args list could be slightly more concise. Overall, each sentence earns its place.

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

Completeness3/5

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

Given 7 parameters and no annotations or output schema, the description covers the core purpose, most parameters, and return format. However, it lacks details on prerequisites (e.g., repo must be cloned), error conditions, and behavior for invalid inputs, leaving gaps for an agent.

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

Parameters3/5

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

Schema coverage is 0%, so the description must compensate. It explains 5 of 7 parameters (repo_path, files, directories, limit, include_metrics) with defaults and purpose, but omits branch and cache_strategy. The return format adds context, but missing parameter descriptions lower the score.

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 that the tool analyzes and identifies structurally significant files using complexity metrics, which is a specific verb-resource pair. It distinguishes from siblings like get_repo_structure (which lists files hierarchically) by focusing on importance scoring.

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

Usage Guidelines2/5

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

The description does not explicitly guide when to use this tool versus alternatives like get_repo_structure or get_repo_file_content. It implies use for understanding system structure but offers no exclusions or direct comparisons.

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