Skip to main content
Glama
codingthefuturewithai

Code Understanding MCP Server

get_repo_file_content

Access file contents or directory listings from a repository using provided path, branch, and cache options.

Instructions

    Retrieve file contents or directory listings from a repository.

    Args:
        repo_path (str): Path or URL to the repository
        resource_path (str, optional): Path to the target file or directory within the repository. Defaults to the repository root if not provided.
        branch (str, optional): Specific branch to read from (only used with per-branch cache strategy)
        cache_strategy (str, optional): Cache strategy - "shared" (default) or "per-branch"

    Returns:
        dict: For files:
            {
                "type": "file",
                "path": str,  # Relative path within repository
                "content": str,  # Complete file contents
                "branch": str,  # Current branch name
                "cache_strategy": str  # Cache strategy used
            }
            For directories:
            {
                "type": "directory",
                "path": str,  # Relative path within repository
                "contents": List[str],  # List of immediate files and subdirectories
                "branch": str,  # Current branch name
                "cache_strategy": str  # Cache strategy used
            }

    Note:
        Directory listings are not recursive - they only show immediate contents.
        To explore subdirectories, make additional calls with the subdirectory path.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchNo
repo_pathYes
resource_pathNo
cache_strategyNoshared
Behavior4/5

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

With no annotations, the description fully discloses behavioral traits: it returns either file content or directory listing, specifies non-recursive listings, and documents return fields. It does not mention authentication or rate limits, but for a read operation this is adequate.

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 Args, Returns, and Note sections, making it easy to scan. However, it is somewhat verbose; the Returns section could be shortened by referencing the schema, but overall it remains clear.

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 fully documents return values for both file and directory cases. It also explains the non-recursive nature of directory listings, making it complete for an agent to understand the tool's behavior.

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%, so the description must compensate. It explains each parameter (repo_path, resource_path, branch, cache_strategy) in detail, including defaults and optionality, adding significant meaning beyond the schema.

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 file contents or directory listings from a repository, using specific verbs and resource context. It distinguishes itself from siblings like get_repo_structure by focusing on specific file content rather than structure.

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

Usage Guidelines3/5

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

The description provides a note about non-recursive directory listings, which is useful context. However, it does not explicitly compare to sibling tools or state when to use this tool over alternatives like 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