Skip to main content
Glama
lfnovo

Code Expert MCP Server

by lfnovo

get_repo_critical_files

Identify and rank structurally critical files in a repository using complexity and size metrics, directing attention to high-impact code for faster understanding.

Instructions

Identify and analyze the most structurally significant files in a repository to guide code understanding efforts.

PARAMETER:

RESPONSE CHARACTERISTICS:

  1. Analysis Metrics:

    • Calculates importance scores based on:

      • Function count (weight: 2.0)

      • Total cyclomatic complexity (weight: 1.5)

      • Maximum cyclomatic complexity (weight: 1.2)

      • Lines of code (weight: 0.05)

    • Provides detailed metrics per file

    • Ranks files by composite importance score

  2. Resource Management:

    • Repository must be previously cloned via clone_repo

    • Analysis performed on-demand using Lizard

    • Efficient for both small and large codebases

    • Supports both full-repo and targeted analysis

  3. Scope Control Options:

    • 'files': Analyze specific files. If only this is provided, the entire repository will be searched for matching file names.

    • 'directories': Analyze all source files within specific directories.

    • If BOTH 'files' and 'directories' are provided, the tool will perform an INTERSECTION, analyzing only the files named in 'files' that are also located within the specified 'directories'.

    • 'limit': Control maximum results returned.

  4. Response Metadata:

    • Total files analyzed

    • Analysis completion status

NOTE: This tool is designed to guide initial codebase exploration by identifying structurally significant files. Results can be used to target subsequent get_source_repo_map calls for detailed analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesNo
limitNo
repo_pathYes
directoriesNo
include_metricsNo
Behavior5/5

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

With no annotations provided, the description carries the full burden and excels. It reveals internal behavior such as the exact weighted scoring formula (function count, cyclomatic complexity, LOC), use of Lizard for on-demand analysis, and the intersection scope logic when both files and directories are supplied.

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

Conciseness5/5

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

The description is well-organized with clear sections (PARAMETER, RESPONSE CHARACTERISTICS, Scope Control, NOTE) and front-loaded purpose. Every sentence adds value, covering prerequisites, metrics, scope semantics, and output metadata without fluff.

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 no output schema exists, the description thoroughly explains response characteristics: metric details, ranking, and response metadata. It also covers prerequisites, scope control nuances, and overall use-case context. The only minor gap is include_metrics, but overall the description is remarkably complete for a complex tool.

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

Parameters4/5

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

The description provides substantial semantic value for repo_path (with examples and auto-normalization), files, directories, and limit. It explains the intersection behavior and repo-wide search for files. However, include_metrics is not mentioned at all, leaving its meaning to inference despite being a parameter.

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 first sentence clearly states the tool's purpose: to identify and analyze the most structurally significant files in a repository to guide code understanding. It distinguishes itself from siblings like get_source_repo_map by positioning itself as an initial exploration tool whose results feed into subsequent, more detailed analysis calls.

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

Usage Guidelines5/5

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

The NOTE explicitly states it is designed for initial codebase exploration and mentions how results can be used to target subsequent get_source_repo_map calls. It also provides a clear prerequisite: the repository must be previously cloned via clone_repo, and describes supported analysis modes (full-repo vs. targeted).

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/lfnovo/code-expert-mcp'

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