Skip to main content
Glama
ConnorBoetig-dev

Unrestricted Development MCP Server

git_config

Manage Git configuration settings by getting, setting, or listing values for repository or global scope to customize your development workflow.

Instructions

Get or set git configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoRepository directory
actionNoConfig actionlist
keyNoConfig key (required for get/set)
valueNoConfig value (required for set)
globalNoUse global config instead of repository config

Implementation Reference

  • Main handler function that executes git config commands based on action (list/get/set) using the shared executeGitCommand helper.
    export async function gitConfig(args: z.infer<typeof gitConfigSchema>): Promise<ToolResponse> {
      const globalFlag = args.global ? '--global' : '';
    
      switch (args.action) {
        case 'list':
          return executeGitCommand(`git config ${globalFlag} --list`.trim(), args.cwd);
        case 'get':
          if (!args.key) {
            return {
              content: [{ type: "text", text: JSON.stringify({ success: false, error: 'Key required for get action' }, null, 2) }],
              isError: true
            };
          }
          return executeGitCommand(`git config ${globalFlag} ${args.key}`.trim(), args.cwd);
        case 'set':
          if (!args.key || !args.value) {
            return {
              content: [{ type: "text", text: JSON.stringify({ success: false, error: 'Key and value required for set action' }, null, 2) }],
              isError: true
            };
          }
          return executeGitCommand(`git config ${globalFlag} ${args.key} "${args.value}"`.trim(), args.cwd);
        default:
          return {
            content: [{ type: "text", text: JSON.stringify({ success: false, error: 'Invalid config action' }, null, 2) }],
            isError: true
          };
      }
    }
  • Zod schema used for input validation in the gitConfig handler.
    export const gitConfigSchema = z.object({
      cwd: z.string().optional().describe('Repository directory'),
      action: z.enum(['get', 'set', 'list']).optional().default('list').describe('Config action'),
      key: z.string().optional().describe('Config key (required for get/set)'),
      value: z.string().optional().describe('Config value (required for set)'),
      global: z.boolean().optional().default(false).describe('Use global config instead of repository config')
    });
  • MCP tool registration/definition in the gitTools array, including name, description, and JSON inputSchema.
    {
      name: 'git_config',
      description: 'Get or set git configuration',
      inputSchema: {
        type: 'object',
        properties: {
          cwd: { type: 'string', description: 'Repository directory' },
          action: { type: 'string', enum: ['get', 'set', 'list'], default: 'list', description: 'Config action' },
          key: { type: 'string', description: 'Config key (required for get/set)' },
          value: { type: 'string', description: 'Config value (required for set)' },
          global: { type: 'boolean', default: false, description: 'Use global config instead of repository config' }
        }
      }
    }
  • src/index.ts:437-440 (registration)
    Dispatcher/registration in main index.ts handler that routes 'git_config' calls to the gitConfig function after schema validation.
    if (name === 'git_config') {
      const validated = gitConfigSchema.parse(args);
      return await gitConfig(validated);
    }
  • Shared helper function used by all git tools (including git_config) to execute git commands and format responses.
    async function executeGitCommand(command: string, cwd?: string): Promise<ToolResponse> {
      try {
        const { stdout, stderr } = await execAsync(command, {
          cwd: cwd || process.cwd(),
          shell: '/bin/bash',
          maxBuffer: 10 * 1024 * 1024 // 10MB buffer
        });
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                success: true,
                command: command,
                stdout: stdout.trim(),
                stderr: stderr.trim(),
                cwd: cwd || process.cwd()
              }, null, 2)
            }
          ]
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify({
                success: false,
                command: command,
                stdout: error.stdout?.trim() || '',
                stderr: error.stderr?.trim() || error.message,
                exitCode: error.code || 1,
                cwd: cwd || process.cwd()
              }, null, 2)
            }
          ],
          isError: true
        };
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Get or set git configuration' implies both read and write operations, but doesn't specify permissions needed, whether changes are reversible, if it affects local vs. remote repositories, or what the output format looks like. For a tool with mutation capability and no annotation coverage, this is insufficient.

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 extremely concise at just four words, front-loading the core functionality with zero wasted words. Every element ('Get or set git configuration') directly contributes to understanding the tool's purpose.

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 this is a multi-action tool (get/set/list) with mutation capability, no annotations, and no output schema, the description is inadequate. It doesn't explain the different behaviors for each action, what configuration scope it affects, or what format results return. The agent would struggle to use this tool correctly without trial and error.

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, so parameters are well-documented in the schema itself. The description adds no additional parameter semantics beyond what's already in the schema (like explaining the relationship between action, key, and value parameters). This meets the baseline expectation when schema coverage is complete.

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 'Get or set git configuration' clearly states the verb ('get or set') and resource ('git configuration'), making the purpose immediately understandable. However, it doesn't differentiate this tool from its many git-related siblings (like git_add, git_commit, etc.), which would require specifying it's specifically for configuration management rather than other git operations.

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. There's no mention of prerequisites (like needing a git repository), comparison with other git tools, or typical use cases. The agent must infer usage entirely from the tool name and parameters.

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/ConnorBoetig-dev/mcp2'

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