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 }; } }

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