Skip to main content
Glama

get_codebase

Clone any Git repository and generate a structured text file containing its file structure, all text file contents, and estimated token count, while respecting .gitignore and .repomixignore patterns.

Instructions

    Clone a Git repository and generate a structured text file containing its contents.

    This tool clones a git repository from the provided URL, processes its contents,
    and returns a single text file containing the repository structure and the content
    of all files. Binary files and empty text files are excluded. The tool respects
    .gitignore and .repomixignore patterns. The output includes an estimated token count
    using the o200k_base encoding.

    Args:
        repo_url (str): The URL of the Git repository to clone
        use_token (bool, optional): Whether to use the GitLab token for authentication.
                                   Defaults to True.

    Returns:
        str: A formatted text representation of the repository contents, including
             file structure, estimated token count, and the content of all text files.

    Raises:
        GitCommandError: If there is an error during the git clone operation
        Exception: For any other errors that occur during processing
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_urlYes
use_tokenNo
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses key behaviors: binary/empty files are excluded, .gitignore and .repomixignore are respected, token count uses o200k_base, optional GitLab token usage, and specific exceptions like GitCommandError. Missing cleanup/disposal details, but this is a strong disclosure.

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 a summary, detailed behavior, Args, Returns, and Raises sections. It is slightly verbose but every sentence adds useful information, and the main purpose is front-loaded. More concise than most tool descriptions.

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?

The description covers the input, processing behavior, output format, error handling, and authentication nuance. There is no output schema, so the Returns section adequately explains the return value. For a tool of this complexity, the description is complete.

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?

Despite 0% schema coverage, the description's Args section fully explains both parameters: repo_url is the repository URL, use_token controls GitLab token authentication with a default of True. This completely compensates for the schema's lack of descriptions.

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 starts with a specific verb+resource: 'Clone a Git repository and generate a structured text file containing its contents.' It clearly distinguishes this from sibling tools like get_file (which likely fetches a single file) by specifying the full repository processing scope.

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

Usage Guidelines4/5

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

The description clearly states what the tool does and the general context for use. However, it does not explicitly mention when not to use it or provide alternatives such as 'get_file' for single-file access or 'estimate_codebase' for token estimation, so it misses the explicit exclusion/alternative 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/jmiedzinski/mcp-git-explorer'

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