Skip to main content
Glama

create_tag

Create new tags in GitHub repositories to mark specific commits for versioning or releases.

Instructions

Create a new tag in a GitHub repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner (username or organization)
repoYesRepository name
refYesThe name of the fully qualified reference (e.g., refs/tags/v1.0.0)
shaYesThe SHA1 value to set this reference to

Implementation Reference

  • The core handler function that implements the create_tag tool by making a POST request to GitHub's git/refs endpoint to create a tag reference pointing to the specified SHA.
    export async function createTag(
      github_pat: string,
      owner: string,
      repo: string,
      ref: string,
      sha: string
    ): Promise<z.infer<typeof TagSchema>> {
      // Ensure the ref is properly formatted
      const formattedRef = ref.startsWith("refs/") ? ref : `refs/tags/${ref}`;
      
      const response = await githubRequest(
        github_pat,
        `https://api.github.com/repos/${owner}/${repo}/git/refs`,
        {
          method: "POST",
          body: {
            ref: formattedRef,
            sha,
          },
        }
      );
      
      return TagSchema.parse(response);
    }
  • Zod input schemas for the create_tag tool: public CreateTagSchema and internal _CreateTagSchema including github_pat.
    export const CreateTagSchema = z.object({
      owner: z.string().describe("Repository owner (username or organization)"),
      repo: z.string().describe("Repository name"),
      ref: z.string().describe("The name of the fully qualified reference (e.g., refs/tags/v1.0.0)"),
      sha: z.string().describe("The SHA1 value to set this reference to")
    });
    
    export const _CreateTagSchema = CreateTagSchema.extend({
      github_pat: z.string().describe("GitHub Personal Access Token"),
    });
  • src/index.ts:189-193 (registration)
    Registration of the create_tag tool in the MCP server's tool list, providing name, description, and input schema reference.
    {
      name: "create_tag",
      description: "Create a new tag in a GitHub repository",
      inputSchema: zodToJsonSchema(releases.CreateTagSchema),
    },
  • Dispatch handler in the main CallToolRequest switch statement that parses arguments and delegates to the releases.createTag implementation.
    case "create_tag": {
      const args = releases._CreateTagSchema.parse(params.arguments);
      const { github_pat, owner, repo, ref, sha } = args;
      const result = await releases.createTag(github_pat, owner, repo, ref, sha);
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    }
  • Output schema (TagSchema) used by the createTag handler to validate the GitHub API response.
    export const TagSchema = z.object({
      ref: z.string(),
      node_id: z.string(),
      url: z.string(),
      object: z.object({
        sha: z.string(),
        type: z.string(),
        url: z.string(),
      }),
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states 'Create' which implies a write/mutation operation, but doesn't disclose behavioral traits like required permissions (e.g., push access to the repo), whether it overwrites existing tags, rate limits, or what happens on success/failure. This leaves significant gaps for an agent to use it safely.

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 a single, clear sentence with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly.

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 no annotations and no output schema, this is a mutation tool with incomplete context. The description doesn't cover behavioral aspects (permissions, side effects) or return values, which are critical for safe invocation. It's inadequate for a tool that modifies repository state.

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 4 parameters (owner, repo, ref, sha). The description adds no additional meaning about parameters beyond implying they're needed for tag creation. 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 action ('Create') and resource ('new tag in a GitHub repository'), making the purpose immediately understandable. It doesn't distinguish from siblings like 'create_release' or 'create_branch' which also create GitHub resources, but the specificity to tags is adequate.

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. For example, it doesn't clarify if this is for lightweight tags versus annotated tags, or how it differs from 'create_release' which might also involve tagging. The description only states what it does, not when to choose it.

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/MissionSquad/mcp-github'

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