Skip to main content
Glama
narumiruna

Gitingest MCP Server

ingest_git

Analyze and clone a Git repository or local directory, then process files based on specified patterns and parameters. Retrieve summaries, file structures, or file contents directly.

Instructions

This function analyzes a source (URL or local path), clones the corresponding repository (if applicable), and processes its files according to the specified query parameters. It can return a summary, a tree-like structure of the files, or the content of the files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchNoThe branch to clone and ingest.main
exclude_patternsNoPattern or set of patterns specifying which files to exclude, e.q. '*.md, src/'
include_patternsNoPattern or set of patterns specifying which files to include, e.q. '*.md, src/'
max_file_sizeNoMaximum allowed file size for file ingestion.Files larger than this size are ignored, by default 10*1024*1024 (10 MB).
sourceYesThe source to analyze, which can be a URL (for a Git repository) or a local directory path.

Implementation Reference

  • The core handler function for the 'ingest_git' MCP tool. It defines the input parameters with descriptions (schema), is registered via @mcp.tool(), and implements the logic by calling the external ingest_async function to process the git repository or directory and return a combined summary, tree, and content.
    @mcp.tool()
    async def ingest_git(
        source: Annotated[
            str,
            Field(
                description="The source to analyze, which can be a URL (for a Git repository) or a local directory path."
            ),
        ],
        max_file_size: Annotated[
            int,
            Field(
                description=(
                    "Maximum allowed file size for file ingestion."
                    "Files larger than this size are ignored, by default 10*1024*1024 (10 MB)."
                )
            ),
        ] = 10 * 1024 * 1024,
        include_patterns: Annotated[
            str,
            Field(description="Pattern or set of patterns specifying which files to include, e.q. '*.md, src/'"),
        ] = "",
        exclude_patterns: Annotated[
            str,
            Field(description="Pattern or set of patterns specifying which files to exclude, e.q. '*.md, src/'"),
        ] = "",
        branch: Annotated[str, Field(description="The branch to clone and ingest.")] = "main",
    ) -> str:
        """
        This function analyzes a source (URL or local path), clones the corresponding repository (if applicable),
        and processes its files according to the specified query parameters.
        It can return a summary, a tree-like structure of the files, or the content of the files.
        """
        summary, tree, content = await ingest_async(
            source,
            max_file_size=max_file_size,
            include_patterns=include_patterns,
            exclude_patterns=exclude_patterns,
            branch=branch,
        )
    
        return "\n\n".join(
            [
                summary,
                tree,
                content,
            ]
        )
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions cloning and processing behaviors but omits critical details: whether it requires authentication, rate limits, side effects (e.g., local storage), error handling, or output format specifics. For a tool with potential external operations, this is insufficient 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 appropriately concise with three sentences that efficiently outline the tool's flow: analyze source, clone if needed, process with parameters. It's front-loaded with core functionality, though slightly vague in the last sentence about return types. No wasted words, but could be tighter.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and a tool that performs complex operations (cloning, processing), the description is incomplete. It lacks details on authentication, rate limits, output formats, error cases, and how return types (summary, tree, content) are selected. For a 5-parameter tool with external dependencies, this leaves significant gaps for an agent.

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?

Schema description coverage is 100%, providing detailed parameter documentation. The description adds minimal value beyond the schema, only implying that parameters control 'query parameters' for processing. It doesn't explain interactions between parameters (e.g., patterns vs. size limits) or usage nuances, meeting the baseline for high schema coverage.

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: analyzing a source, cloning repositories, and processing files with specific query parameters. It specifies the verb ('analyzes', 'clones', 'processes') and resource ('source', 'repository', 'files'), but lacks differentiation from siblings since none exist. It's not tautological but could be more specific about the 'analysis' aspect.

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, prerequisites, or exclusions. It mentions query parameters but doesn't explain scenarios for choosing summary, tree structure, or file content outputs. With no sibling tools, this is less critical, but overall usage context is minimal.

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/narumiruna/gitingest-mcp'

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