Skip to main content
Glama
codingthefuturewithai

Code Understanding MCP Server

refresh_repo

Updates a cached repository with the latest changes from the source, then rebuilds the repository map to ensure analysis reflects current code.

Instructions

    Update a previously cloned repository in MCP's cache and refresh its analysis.

    CRITICAL: Cached repositories become stale over time. ALWAYS refresh before analysis
    to ensure you're working with the latest code. Failure to refresh means your analysis
    may be based on outdated code that could be days, weeks, or months old.

    For Git repositories, performs a git pull to get latest changes.
    For local directories, copies the latest content from the source.
    Then triggers a new repository map build to ensure all analysis is based on
    the updated code.

    RECOMMENDED WORKFLOW:
        1. Check if repository is cached: list_cached_repository_branches(url)
        2. If cached, ALWAYS refresh first: refresh_repo(url)
        3. Wait a moment for refresh to complete
        4. Then perform analysis: get_source_repo_map(url, ...)

        This ensures your analysis reflects current code, not stale cached data.

    Args:
        repo_path (str): Path or URL matching what was originally provided to clone_repo
        branch (str, optional): Specific branch to switch to during refresh
        cache_strategy (str, optional): Cache strategy - must match original clone strategy

    Returns:
        dict: Response with format:
            {
                "status": str,  # "pending", "switched_branch", "error"
                "path": str,    # (On pending) Cache location being refreshed
                "message": str, # (On pending) Status message
                "error": str    # (On error) Error message
                "cache_strategy": str  # Strategy used for caching
            }

    Note:
        - Repository must be previously cloned and have completed initial analysis
        - Updates MCP's cached copy, does not modify the source repository
        - Automatically triggers rebuild of repository map with updated files
        - If branch is specified, switches to that branch after pulling latest changes
        - cache_strategy should match the strategy used during original clone
        - Operation runs in background, check get_repo_map_content for status
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchNo
repo_pathYes
cache_strategyNoshared
Behavior5/5

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

With no annotations provided, the description fully discloses behavioral traits: it performs git pull or local copy, triggers a repository map rebuild, runs in background, does not modify the source repository, and requires prior clone completion. It also notes that the operation is asynchronous and status can be checked via get_repo_map_content. No contradictions.

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-structured with clear sections: overview, critical note, recommended workflow, args, returns, and notes. It is front-loaded with the core action and uses bold for emphasis. Each sentence adds value without redundancy. Despite length, it is efficient for the tool's complexity.

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, the description includes a sample return dict with all fields. It covers prerequisites (must be cloned and analyzed), background operation, and status checking. The notes address edge cases like branch switching and cache_strategy matching. The description is complete for an agent to use the tool correctly.

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 schema description coverage is 0%, but the description adds value by explaining the meaning and constraints of each parameter: repo_path must match original clone, branch switches to specific branch, cache_strategy must match original. It could have elaborated on cache_strategy values (e.g., 'shared' default), but provides sufficient context for correct invocation.

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 the tool's purpose: 'Update a previously cloned repository in MCP's cache and refresh its analysis.' It distinguishes from sibling tools like clone_repo and get_repo_* by specifying that it operates on already-cloned repositories and performs git pull or directory copy. The verb 'refresh' is specific and appropriate.

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 description provides explicit when-to-use guidance, including a 'RECOMMENDED WORKFLOW' that tells the agent to check cache first (using list_cached_repository_branches) and always refresh before analysis. It warns that failure to refresh leads to stale data, effectively directing the agent away from direct analysis without refresh.

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