Skip to main content
Glama
ConnorBoetig-dev

Unrestricted Development MCP Server

git_remote

Manage Git remote repositories by listing, adding, removing, or showing remote connections to control version control collaboration and repository links.

Instructions

Manage remote repositories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoRepository directory
actionNoRemote actionlist
nameNoRemote name (required for add/remove/show)
urlNoRemote URL (required for add)

Implementation Reference

  • The main handler function for the 'git_remote' tool. Executes git remote commands (list, add, remove, show) using the shared executeGitCommand helper, with input validation via gitRemoteSchema.
    export async function gitRemote(args: z.infer<typeof gitRemoteSchema>): Promise<ToolResponse> {
      switch (args.action) {
        case 'list':
          return executeGitCommand('git remote -v', args.cwd);
        case 'add':
          if (!args.name || !args.url) {
            return {
              content: [{ type: "text", text: JSON.stringify({ success: false, error: 'Name and URL required for add action' }, null, 2) }],
              isError: true
            };
          }
          return executeGitCommand(`git remote add ${args.name} ${args.url}`, args.cwd);
        case 'remove':
          if (!args.name) {
            return {
              content: [{ type: "text", text: JSON.stringify({ success: false, error: 'Name required for remove action' }, null, 2) }],
              isError: true
            };
          }
          return executeGitCommand(`git remote remove ${args.name}`, args.cwd);
        case 'show':
          if (!args.name) {
            return {
              content: [{ type: "text", text: JSON.stringify({ success: false, error: 'Name required for show action' }, null, 2) }],
              isError: true
            };
          }
          return executeGitCommand(`git remote show ${args.name}`, args.cwd);
        default:
          return {
            content: [{ type: "text", text: JSON.stringify({ success: false, error: 'Invalid remote action' }, null, 2) }],
            isError: true
          };
      }
  • Zod schema for validating inputs to the git_remote tool, used in the dispatch handler in index.ts.
    export const gitRemoteSchema = z.object({
      cwd: z.string().optional().describe('Repository directory'),
      action: z.enum(['list', 'add', 'remove', 'show']).optional().default('list').describe('Remote action'),
      name: z.string().optional().describe('Remote name (required for add/remove/show)'),
      url: z.string().optional().describe('Remote URL (required for add)')
    });
  • src/index.ts:413-416 (registration)
    Dispatch registration in the main MCP server handler. Matches tool name, validates args with schema, and calls the gitRemote handler.
    if (name === 'git_remote') {
      const validated = gitRemoteSchema.parse(args);
      return await gitRemote(validated);
    }
  • MCP tool definition in gitTools array, including inputSchema for tool listing. Mirrors the Zod schema.
    {
      name: 'git_remote',
      description: 'Manage remote repositories',
      inputSchema: {
        type: 'object',
        properties: {
          cwd: { type: 'string', description: 'Repository directory' },
          action: { type: 'string', enum: ['list', 'add', 'remove', 'show'], default: 'list', description: 'Remote action' },
          name: { type: 'string', description: 'Remote name (required for add/remove/show)' },
          url: { type: 'string', description: 'Remote URL (required for add)' }
        }
      }
  • Shared helper function used by all git tools, including gitRemote, 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?

No annotations are provided, so the description carries full burden. It doesn't disclose behavioral traits such as whether actions are destructive (e.g., 'remove' deletes remote references), authentication needs for URLs, or error handling. The description is too generic to inform the agent about critical operational aspects.

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 a single, efficient sentence with no wasted words. It's appropriately sized for a tool with a clear scope, though it could be more informative. The structure is front-loaded but lacks detail that might be necessary given the tool's complexity.

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 tool's complexity (4 parameters, multiple actions including destructive ones) and lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects, usage context, or output expectations, leaving significant gaps for an AI agent to understand how to invoke it correctly.

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 fully documents parameters. The description adds no meaning beyond what the schema provides (e.g., it doesn't explain parameter interactions or constraints like 'name' being required for specific actions). Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Manage remote repositories' states the general purpose but is vague about what specific actions are available. It doesn't distinguish this tool from other git tools like git_clone or git_fetch, which also involve remote repositories. The verb 'manage' is broad and doesn't specify the exact 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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an initialized repository), nor does it differentiate from sibling tools like git_clone (for initial setup) or git_fetch/push (for data transfer). Usage is implied through the action parameter but not explicitly stated.

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