Skip to main content
Glama
ConnorBoetig-dev

Unrestricted Development MCP Server

git_tag

Manage Git tags by creating annotated tags, listing existing tags, or deleting tags from your repository to mark release points and organize version history.

Instructions

Create, list, or delete tags

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoRepository directory
actionNoTag actionlist
nameNoTag name (required for create/delete)
messageNoTag message (for annotated tags)
commitNoCommit to tag (defaults to HEAD)

Implementation Reference

  • Main handler function that implements git tag operations: list tags, create lightweight or annotated tags, delete tags using git commands.
    export async function gitTag(args: z.infer<typeof gitTagSchema>): Promise<ToolResponse> {
      switch (args.action) {
        case 'list':
          return executeGitCommand('git tag -l', args.cwd);
        case 'create':
          if (!args.name) {
            return {
              content: [{ type: "text", text: JSON.stringify({ success: false, error: 'Tag name required for create action' }, null, 2) }],
              isError: true
            };
          }
          const messageFlag = args.message ? `-a -m "${args.message}"` : '';
          const commit = args.commit || '';
          return executeGitCommand(`git tag ${messageFlag} ${args.name} ${commit}`.trim(), args.cwd);
        case 'delete':
          if (!args.name) {
            return {
              content: [{ type: "text", text: JSON.stringify({ success: false, error: 'Tag name required for delete action' }, null, 2) }],
              isError: true
            };
          }
          return executeGitCommand(`git tag -d ${args.name}`, args.cwd);
        default:
          return {
            content: [{ type: "text", text: JSON.stringify({ success: false, error: 'Invalid tag action' }, null, 2) }],
            isError: true
          };
      }
  • Zod input schema for validating git_tag tool arguments.
    export const gitTagSchema = z.object({
      cwd: z.string().optional().describe('Repository directory'),
      action: z.enum(['list', 'create', 'delete']).optional().default('list').describe('Tag action'),
      name: z.string().optional().describe('Tag name (required for create/delete)'),
      message: z.string().optional().describe('Tag message (for annotated tags)'),
      commit: z.string().optional().describe('Commit to tag (defaults to HEAD)')
    });
  • Tool definition/registration in the gitTools array exported for MCP server.
      name: 'git_tag',
      description: 'Create, list, or delete tags',
      inputSchema: {
        type: 'object',
        properties: {
          cwd: { type: 'string', description: 'Repository directory' },
          action: { type: 'string', enum: ['list', 'create', 'delete'], default: 'list', description: 'Tag action' },
          name: { type: 'string', description: 'Tag name (required for create/delete)' },
          message: { type: 'string', description: 'Tag message (for annotated tags)' },
          commit: { type: 'string', description: 'Commit to tag (defaults to HEAD)' }
        }
      }
    },
  • src/index.ts:429-432 (registration)
    Dispatch handler in main MCP server that validates arguments and calls the gitTag handler for 'git_tag' tool invocations.
    if (name === 'git_tag') {
      const validated = gitTagSchema.parse(args);
      return await gitTag(validated);
    }
  • Shared helper function used by all git tools to execute git commands with proper error handling and JSON response formatting.
    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 the full burden of behavioral disclosure. It mentions actions but fails to explain critical behaviors: whether operations are destructive (e.g., delete is irreversible), permission requirements, or how outputs are structured. This leaves significant gaps for safe and effective use.

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 with a single, front-loaded phrase that efficiently communicates the core functionality. Every word earns its place, making it easy to parse without wasted text.

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 (multiple actions including destructive operations) and lack of annotations or output schema, the description is incomplete. It doesn't address behavioral risks, output formats, or usage contexts, leaving the agent under-informed for safe invocation.

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 all 5 parameters. The description adds no additional meaning beyond implying the tool handles tags, which is already clear from the name. 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.

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 with specific verbs (create, list, delete) and resource (tags), making it immediately understandable. However, it doesn't differentiate from sibling tools like git_branch or git_commit, which also manage Git objects, so it misses full sibling differentiation.

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. The description lists actions but doesn't specify contexts, prerequisites, or exclusions, leaving the agent to infer usage from the schema alone.

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