Skip to main content
Glama

create_tag

Generate a new tag in a GitHub repository by specifying the owner, repo, ref, and SHA. Streamlines version control and tracking for developers.

Instructions

Create a new tag in a GitHub repository

Input Schema

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

Implementation Reference

  • The core handler function that implements the create_tag tool logic by creating a Git tag reference via the GitHub API.
    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 schemas defining the input parameters for the create_tag tool, including public schema and internal version with 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)
    Tool registration in the list of available tools returned by ListToolsRequestSchema.
    { name: "create_tag", description: "Create a new tag in a GitHub repository", inputSchema: zodToJsonSchema(releases.CreateTagSchema), },
  • Dispatch handler in the main CallToolRequestSchema switch that parses arguments and delegates to the releases.createTag function.
    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) }], }; }

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