Skip to main content
Glama

list_repositories

Retrieve a list of all Git repositories stored in a specified directory path using the Git MCP server, for easy management and access.

Instructions

List all git repositories in the configured path

Returns:
    List of repository names

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'list_repositories' tool. It retrieves the git_repos_path from the context, lists directories containing a .git folder, and returns their names as a list of strings. The @mcp.tool() decorator registers this function as an MCP tool.
    @mcp.tool()
    def list_repositories(ctx: Context) -> List[str]:
        """List all git repositories in the configured path
    
        Returns:
            List of repository names
        """
        git_repos_path = ctx.request_context.lifespan_context.git_repos_path
    
        if not os.path.exists(git_repos_path):
            raise ValueError(f"Git repositories path does not exist: {git_repos_path}")
    
        repos = []
        for item in os.listdir(git_repos_path):
            item_path = os.path.join(git_repos_path, item)
            if os.path.isdir(item_path) and os.path.exists(os.path.join(item_path, ".git")):
                repos.append(item)
    
        return repos
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it 'list all git repositories' and returns 'list of repository names'. It doesn't disclose behavioral traits like whether it's read-only, if it requires authentication, potential rate limits, or how it handles errors, leaving significant gaps for a tool with siblings that involve mutations.

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 front-loaded with the core purpose in the first sentence and adds return value details concisely. It avoids redundancy, but could be slightly more structured by separating usage notes from return details for clarity.

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 the tool has no parameters, an output schema exists, and siblings include mutation tools, the description is minimally adequate. It covers purpose and return values but lacks context on when to use it versus siblings and behavioral details, making it incomplete for optimal agent guidance.

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 tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description appropriately omits parameter details, earning a high baseline score for not adding unnecessary information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'list' and resource 'git repositories' with scope 'in the configured path', making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'refresh_repository' or 'list_commits_since_last_tag', which prevents a perfect score.

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 provides no guidance on when to use this tool versus alternatives like 'refresh_repository' or 'list_commits_since_last_tag'. It lacks context about prerequisites, such as whether the path must be pre-configured or if this is a read-only operation compared to siblings.

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

Related 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/kjozsa/git-mcp'

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