Skip to main content
Glama
codingthefuturewithai

Code Understanding MCP Server

list_cached_repository_branches

Check if a repository is cached and list all cached branch versions to avoid redundant clone attempts before analysis.

Instructions

    Check if a repository is already cached and list all cached branch versions.

    USE THIS FIRST before calling clone_repo to avoid redundant clone attempts.
    If the repository is already cached, you can proceed directly to refresh_repo
    and analysis instead of cloning again.

    This tool scans the MCP cache to find all entries for a given repository URL,
    showing both shared and per-branch cache entries. Useful for understanding
    what branches are available and their current status.

    Args:
        repo_url (str): Repository URL to search for (must match exact URL used in clone_repo)

    Returns:
        dict: Response with format:
            {
                "status": "success" | "error",
                "repo_url": str,  # Repository URL searched
                "cached_branches": [  # List of cached branch entries (empty if not cached)
                    {
                        "requested_branch": str,  # Branch that was requested during clone
                        "current_branch": str,    # Current active branch in the cache
                        "cache_path": str,        # File system path to cached repository
                        "cache_strategy": str,    # "shared" or "per-branch"
                        "last_access": str,       # ISO timestamp of last access
                        "clone_status": dict,     # Clone operation status
                        "repo_map_status": dict   # Repository map build status
                    }
                ],
                "total_cached": int  # Total number of cached entries (0 if not cached)
            }

    Typical Workflow:
        1. Check cache first: result = list_cached_repository_branches(url)
        2. If result["total_cached"] > 0:
           - Repository is cached, skip clone
           - Use refresh_repo(url) to update cached code
        3. If result["total_cached"] == 0:
           - Repository not cached yet
           - Use list_remote_branches(url) to discover branch names
           - Use clone_repo(url, branch=correct_branch)

    Note:
        - Only returns repositories that have been cloned via clone_repo
        - Empty cached_branches list means repository is NOT cached
        - Useful for PR review workflows to see all available branch versions
        - Shows both active and completed cache entries
        - Helps identify which cache strategy was used for each entry
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_urlYes
Behavior4/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 scans the MCP cache, shows shared/per-branch entries, only returns repos cloned via clone_repo, and clarifies meaning of empty list. Lacks explicit statement of being read-only but is implied. Overall transparent and informative.

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 relatively long but well-organized: a concise summary, then usage guidance, argument description, return format, workflow, and notes. Every section adds value, and the key purpose is front-loaded. Slightly wordy but efficient.

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 one parameter, no output schema, but the description fully specifies the return format (including dictionaries with fields and types), explains typical workflow, and provides notes and interpretations. It is complete enough for an AI agent to use correctly without additional context.

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 single parameter repo_url has 0% schema description coverage. The description adds essential context: 'must match exact URL used in clone_repo'. This goes beyond the schema's bare title and helps ensure correct usage.

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 checks if a repository is cached and lists cached branch versions. It uses specific verbs ('check', 'list') and distinguishes from siblings like clone_repo. The purpose is unambiguous and well-defined.

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?

Explicitly instructs to use this tool first before clone_repo to avoid redundant clones. Provides a detailed typical workflow with conditional steps (if cached >0 skip clone, else use list_remote_branches and clone_repo). This is exemplary usage guidance.

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