Skip to main content
Glama

tag_create

Create and manage Git tags with a specified name, message, and options like force creation, annotation, or signing. Supports repository path input for precise tag management.

Instructions

Create a tag

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
annotatedNoCreate an annotated tag
forceNoForce create tag even if it exists
messageNoTag message
nameYesTag name
pathNoPath to repository. MUST be an absolute path (e.g., /Users/username/projects/my-repo)
signNoCreate a signed tag

Implementation Reference

  • The core handler function for the 'tag_create' tool. Validates the repository and tag name, constructs the appropriate 'git tag' or 'git tag -a -m' command, executes it using CommandExecutor, formats the output, manages caching, and returns the GitToolResult.
    static async tagCreate({ path, name, message }: TagOptions, context: GitToolContext): Promise<GitToolResult> {
      const resolvedPath = this.getPath({ path });
      return await this.executeOperation(
        context.operation,
        resolvedPath,
        async () => {
          const { path: repoPath } = PathValidator.validateGitRepo(resolvedPath);
          PathValidator.validateTagName(name);
          
          let command = `tag ${name}`;
          if (typeof message === 'string' && message.length > 0) {
            command = `tag -a ${name} -m "${message}"`;
          }
    
          const result = await CommandExecutor.executeGitCommand(
            command,
            context.operation,
            repoPath
          );
    
          return {
            content: [{
              type: 'text',
              text: `Tag '${name}' created successfully\n${CommandExecutor.formatOutput(result)}`
            }]
          };
        },
        {
          command: 'tag_create',
          invalidateCache: true, // Invalidate tag cache
          stateType: RepoStateType.TAG
        }
      );
    }
  • Registers the 'tag_create' tool with the MCP server in the ListTools response, providing the tool name, description, and detailed input JSON schema.
    {
      name: 'tag_create',
      description: 'Create a tag',
      inputSchema: {
        type: 'object',
        properties: {
          path: {
            type: 'string',
            description: `Path to repository. ${PATH_DESCRIPTION}`,
          },
          name: {
            type: 'string',
            description: 'Tag name',
          },
          message: {
            type: 'string',
            description: 'Tag message',
          },
          force: {
            type: 'boolean',
            description: 'Force create tag even if it exists',
            default: false
          },
          annotated: {
            type: 'boolean',
            description: 'Create an annotated tag',
            default: true
          },
          sign: {
            type: 'boolean',
            description: 'Create a signed tag',
            default: false
          }
        },
        required: ['name'],
      },
    },
  • TypeScript interface defining the TagOptions type used for input validation in the tag_create handler.
    export interface TagOptions extends GitOptions, BasePathOptions {
      name: string;
      message?: string;
      force?: boolean;  // Allow force operations
      annotated?: boolean;  // Create an annotated tag
      sign?: boolean;  // Create a signed tag
    }
  • Runtime type guard function isTagOptions used to validate arguments before calling the tag_create handler.
    export function isTagOptions(obj: any): obj is TagOptions {
      return obj && 
        validatePath(obj.path) && 
        typeof obj.name === 'string';
    }
  • Dispatches calls to the 'tag_create' tool by validating arguments with isTagOptions and invoking GitOperations.tagCreate.
    case 'tag_create': {
      const validArgs = this.validateArguments(operation, args, isTagOptions);
      return await GitOperations.tagCreate(validArgs, context);
    }
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. 'Create a tag' implies a write operation, but it doesn't mention permissions needed, whether creation is reversible, potential side effects (e.g., overwriting with force), or what happens on success/failure. This is insufficient for a mutation tool with zero annotation coverage.

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 just two words ('Create a tag'), which is front-loaded and wastes no space. For a tool with a clear name and comprehensive schema, this brevity is appropriate and efficient, earning full marks for conciseness.

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 complexity (a mutation tool with 6 parameters) and lack of annotations and output schema, the description is incomplete. It doesn't explain the tool's behavior, return values, or usage context, leaving significant gaps that could hinder an AI agent's ability to invoke it correctly without relying heavily on the schema alone.

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 6 parameters (e.g., 'path' as absolute repository path, 'force' to override existing tags). The description adds no parameter information beyond what's in the schema, but the high coverage justifies a baseline score of 3, as the schema adequately compensates.

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 'Create a tag' clearly states the action (create) and resource (tag), which is adequate. However, it doesn't distinguish this from sibling tools like 'tag_list' or 'tag_delete' beyond the basic verb, nor does it specify what kind of tag (e.g., Git tag) or context, leaving it somewhat vague.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a repository path), when not to use it (e.g., if a tag already exists without force), or refer to sibling tools like 'tag_list' for checking existing tags. This lack of context makes usage unclear.

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

Related 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/Sheshiyer/git-mcp-v2'

If you have feedback or need assistance with the MCP directory API, please join our Discord server