create_release
Automate GitHub release creation by specifying repository details, tag name, commitish, and release notes. Supports drafts, prereleases, and auto-generating release notes.
Instructions
Create a new release in a GitHub repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Text describing the release | |
| draft | No | true to create a draft (unpublished) release, false to create a published one | |
| generate_release_notes | No | Whether to automatically generate the name and body for this release | |
| name | No | The name of the release | |
| owner | Yes | Repository owner (username or organization) | |
| prerelease | No | true to identify the release as a prerelease, false to identify it as a full release | |
| repo | Yes | Repository name | |
| tag_name | Yes | The name of the tag | |
| target_commitish | No | Specifies the commitish value that determines where the Git tag is created from |
Implementation Reference
- src/operations/releases.ts:128-143 (handler)The core handler function that executes the create_release tool by sending a POST request to GitHub's releases API endpoint.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); }
- src/operations/releases.ts:55-65 (schema)Zod schema defining the input parameters for creating a release, used for validation and JSON schema generation.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)Tool registration in the listTools handler, defining name, description, and input schema.name: "create_release", description: "Create a new release in a GitHub repository", inputSchema: zodToJsonSchema(releases.CreateReleaseSchema), },
- src/index.ts:533-539 (handler)Dispatch handler in the main CallToolRequest switch that parses arguments and delegates to the releases.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) }], };