Skip to main content
Glama
bsreeram08

Git Repo Browser MCP

git_directory_structure

Clone Git repositories to view their directory structure in a tree format, enabling users to explore repository organization without downloading files locally.

Instructions

Clone a Git repository and return its directory structure in a tree format.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_urlYesThe URL of the Git repository

Implementation Reference

  • The core handler function for the git_directory_structure tool. Clones the Git repository using cloneRepo and generates a directory tree using getDirectoryTree, returning the tree as text content or an error message.
    export async function handleGitDirectoryStructure({ repo_url }) {
      try {
        const repoPath = await cloneRepo(repo_url);
        const tree = await getDirectoryTree(repoPath);
        return {
          content: [
            {
              type: "text",
              text: tree,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error: ${error.message}`,
            },
          ],
          isError: true,
        };
      }
  • Defines the tool metadata including name, description, and input schema (requires repo_url string) for use in MCP tool listing.
    {
      name: "git_directory_structure",
      description:
        "Clone a Git repository and return its directory structure in a tree format.",
      inputSchema: {
        type: "object",
        properties: {
          repo_url: {
            type: "string",
            description: "The URL of the Git repository",
          },
        },
        required: ["repo_url"],
      },
  • src/server.js:900-900 (registration)
    Registers the tool name 'git_directory_structure' by mapping it to the handleGitDirectoryStructure handler function in the handlersMap.
    git_directory_structure: handleGitDirectoryStructure,
  • src/server.js:883-883 (registration)
    Provides an alias 'git_ls' that maps to the 'git_directory_structure' tool for user-friendly command naming.
    git_ls: "git_directory_structure",
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions cloning and returning a tree structure, but lacks details on performance (e.g., timeouts for large repos), side effects (e.g., local disk usage from cloning), error handling, or output format specifics. This leaves gaps in understanding the tool's behavior beyond basic functionality.

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 a single, efficient sentence that front-loads the core action and outcome: 'Clone a Git repository and return its directory structure in a tree format.' It avoids redundancy and wastes no words, making it highly concise and well-structured for quick comprehension.

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's moderate complexity (cloning and structuring), no annotations, no output schema, and high schema coverage, the description is minimally adequate. It covers the basic purpose but lacks details on behavioral traits, usage context, and output specifics, which are needed for full completeness in this scenario.

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

Parameters3/5

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

The input schema has 100% description coverage for the single parameter 'repo_url', so the schema already documents it fully. The description does not add any extra meaning, syntax examples, or constraints beyond what the schema provides (e.g., acceptable URL formats like HTTPS vs. SSH). Thus, it meets the baseline for high schema coverage without compensating value.

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 tool's purpose: 'Clone a Git repository and return its directory structure in a tree format.' It specifies the verb ('clone' and 'return') and resource ('Git repository'), but does not explicitly distinguish it from siblings like 'git_read_files' or 'git_archive', which might have overlapping functionality. This makes it clear but not fully differentiated.

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. It does not mention prerequisites (e.g., needing Git installed), exclusions (e.g., not for large repos), or compare it to siblings like 'git_read_files' for file content or 'git_archive' for compressed snapshots. Without such context, usage is implied but not explicit.

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/bsreeram08/git-commands-mcp'

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