Skip to main content
Glama

git_create_tag

Create a Git tag in a local repository, specifying the tag name, message, and type (annotated or lightweight) using the Git Repo Browser MCP tool.

Instructions

Create a tag.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
annotatedNoWhether to create an annotated tag
messageNoTag message (for annotated tags)
repo_pathYesThe path to the local Git repository
tag_nameYesName of the tag

Implementation Reference

  • The core handler function `handleGitCreateTag` that executes the `git_create_tag` tool logic. It uses simpleGit to create either an annotated or lightweight tag in the specified Git repository, returning success or error content.
    export async function handleGitCreateTag({ repo_path, tag_name, message = "", annotated = true, }) { try { const git = simpleGit(repo_path); if (annotated) { await git.addAnnotatedTag(tag_name, message); } else { await git.addTag(tag_name); } return { content: [ { type: "text", text: JSON.stringify( { success: true, message: `Created ${ annotated ? "annotated " : "" }tag: ${tag_name}`, tag: tag_name, }, null, 2 ), }, ], }; } catch (error) { return { content: [ { type: "text", text: JSON.stringify( { error: `Failed to create tag: ${error.message}` }, null, 2 ), }, ], isError: true, }; } }
  • The input schema and metadata definition for the `git_create_tag` tool, used in tool listing and validation.
    name: "git_create_tag", description: "Create a tag.", inputSchema: { type: "object", properties: { repo_path: { type: "string", description: "The path to the local Git repository", }, tag_name: { type: "string", description: "Name of the tag", }, message: { type: "string", description: "Tag message (for annotated tags)", default: "", }, annotated: { type: "boolean", description: "Whether to create an annotated tag", default: true, }, }, required: ["repo_path", "tag_name"], }, },
  • src/server.js:915-915 (registration)
    Maps the tool name `git_create_tag` to its handler function `handleGitCreateTag` in the central handlersMap used for tool execution.
    git_create_tag: handleGitCreateTag,
  • Imports the `handleGitCreateTag` handler from its implementation file into the handlers index module for re-export.
    import { handleGitCreateTag } from "./tag-operations.js";
  • Re-exports the `handleGitCreateTag` handler from the index module, making it available for import in server.js.
    handleGitCreateTag,

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