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
| Name | Required | Description | Default |
|---|---|---|---|
| annotated | No | Whether to create an annotated tag | |
| message | No | Tag message (for annotated tags) | |
| repo_path | Yes | The path to the local Git repository | |
| tag_name | Yes | Name of the tag |
Implementation Reference
- src/handlers/tag-operations.js:11-59 (handler)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, }; } }
- src/server.js:510-536 (schema)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,
- src/handlers/index.js:26-26 (registration)Imports the `handleGitCreateTag` handler from its implementation file into the handlers index module for re-export.import { handleGitCreateTag } from "./tag-operations.js";
- src/handlers/index.js:69-69 (registration)Re-exports the `handleGitCreateTag` handler from the index module, making it available for import in server.js.handleGitCreateTag,