Skip to main content
Glama

create_release

Create a new release in a GitHub repository to package and distribute software versions with tags, descriptions, and optional draft or prerelease status.

Instructions

Create a new release in a GitHub repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner (username or organization)
repoYesRepository name
tag_nameYesThe name of the tag
target_commitishNoSpecifies the commitish value that determines where the Git tag is created from
nameNoThe name of the release
bodyNoText describing the release
draftNotrue to create a draft (unpublished) release, false to create a published one
prereleaseNotrue to identify the release as a prerelease, false to identify it as a full release
generate_release_notesNoWhether to automatically generate the name and body for this release

Implementation Reference

  • The core handler function that executes the create_release tool by sending a POST request to GitHub Releases API and parsing the response.
    export async function createRelease(
      github_pat: string,
      owner: string,
      repo: string,
      options: Omit<z.infer<typeof CreateReleaseSchema>, "owner" | "repo" | "github_pat">
    ): Promise<z.infer<typeof ReleaseSchema>> {
      const response = await githubRequest(
        github_pat,
        `https://api.github.com/repos/${owner}/${repo}/releases`,
        {
          method: "POST",
          body: options,
        }
      );
      return ReleaseSchema.parse(response);
    }
  • Input schema for the create_release tool, defining parameters like owner, repo, tag_name, etc.
    export const CreateReleaseSchema = z.object({
      owner: z.string().describe("Repository owner (username or organization)"),
      repo: z.string().describe("Repository name"),
      tag_name: z.string().describe("The name of the tag"),
      target_commitish: z.string().optional().describe("Specifies the commitish value that determines where the Git tag is created from"),
      name: z.string().optional().describe("The name of the release"),
      body: z.string().optional().describe("Text describing the release"),
      draft: z.boolean().optional().describe("true to create a draft (unpublished) release, false to create a published one"),
      prerelease: z.boolean().optional().describe("true to identify the release as a prerelease, false to identify it as a full release"),
      generate_release_notes: z.boolean().optional().describe("Whether to automatically generate the name and body for this release")
    });
  • src/index.ts:165-168 (registration)
    Registration of the create_release tool in the MCP server tool list.
      name: "create_release",
      description: "Create a new release in a GitHub repository",
      inputSchema: zodToJsonSchema(releases.CreateReleaseSchema),
    },
  • Dispatch handler case in the main CallToolRequestSchema handler that parses arguments and calls the createRelease function.
    case "create_release": {
      const args = releases._CreateReleaseSchema.parse(params.arguments);
      const { github_pat, owner, repo, ...options } = args;
      const result = await releases.createRelease(github_pat, owner, repo, options);
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    }
  • Extended schema including github_pat, used internally for parsing arguments.
    export const _CreateReleaseSchema = CreateReleaseSchema.extend({
      github_pat: z.string().describe("GitHub Personal Access Token"),
    });

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