Skip to main content
Glama
bsreeram08

Git Repo Browser MCP

git_config

Configure Git repository settings by setting or updating configuration keys and values for local, global, or system scopes to customize repository behavior.

Instructions

Configure git settings for the repository.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYesThe path to the local Git repository
scopeNoConfiguration scope (local, global, system)local
keyYesConfiguration key
valueYesConfiguration value

Implementation Reference

  • Main handler function that sets Git configuration for the repository using simpleGit.addConfig and returns formatted success or error response.
    export async function handleGitConfig({
      repo_path,
      scope = "local",
      key,
      value,
    }) {
      try {
        const git = simpleGit(repo_path);
    
        // Set the configuration
        await git.addConfig(key, value, false, scope);
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  success: true,
                  message: `Set ${scope} config ${key}=${value}`,
                  key: key,
                  value: value,
                  scope: scope,
                },
                null,
                2
              ),
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                { error: `Failed to set git config: ${error.message}` },
                null,
                2
              ),
            },
          ],
          isError: true,
        };
      }
    }
  • Input schema definition for the git_config tool, specifying parameters repo_path, scope, key, and value.
    {
      name: "git_config",
      description: "Configure git settings for the repository.",
      inputSchema: {
        type: "object",
        properties: {
          repo_path: {
            type: "string",
            description: "The path to the local Git repository",
          },
          scope: {
            type: "string",
            description: "Configuration scope (local, global, system)",
            default: "local",
            enum: ["local", "global", "system"],
          },
          key: {
            type: "string",
            description: "Configuration key",
          },
          value: {
            type: "string",
            description: "Configuration value",
          },
        },
        required: ["repo_path", "key", "value"],
      },
    },
  • src/server.js:917-917 (registration)
    Maps the 'git_config' tool name to the handleGitConfig handler function in the handlersMap.
    git_config: handleGitConfig,
  • Imports the handleGitConfig function from config-operations.js for re-export.
    import { handleGitConfig } from "./config-operations.js";
  • Re-exports handleGitConfig as part of the handlers index module.
    // Config operations
    handleGitConfig,
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'configure' but doesn't clarify if this is a read/write operation, what permissions are needed, whether changes are reversible, or if it affects the repository state. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior and safety.

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 purpose without waste. It's appropriately sized for a tool with clear parameters, and every word earns its place by stating the essential action and target.

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 the complexity of a configuration tool with 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain return values, error conditions, or behavioral nuances like how scope affects changes. For a mutation tool, more context is needed to ensure safe and correct usage.

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%, so the schema already documents all parameters (repo_path, scope, key, value) with descriptions and enums. The description adds no additional meaning beyond implying configuration of settings, which is redundant with the schema. Baseline 3 is appropriate as the schema does the heavy lifting, but the description doesn't compensate or add 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 verb ('configure') and resource ('git settings for the repository'), making the purpose evident. It distinguishes this tool from siblings like git_commit or git_pull, which perform different operations. However, it doesn't specify what types of settings (e.g., user.name, core.autocrlf) or how it differs from similar tools like git_hooks, keeping it from 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. It doesn't mention prerequisites (e.g., needing an initialized repo), exclusions (e.g., not for remote config), or compare it to siblings like git_attributes for file-specific settings. Usage is implied only by the general purpose, with no explicit context for selection.

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