delete_release
Remove specific GitHub repository releases by providing owner, repo, and release ID. Streamlines version management and clean-up tasks for better repository organization.
Instructions
Delete a release from a GitHub repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner (username or organization) | |
| release_id | Yes | The ID of the release | |
| repo | Yes | Repository name |
Implementation Reference
- src/operations/releases.ts:160-173 (handler)The core handler function that executes the logic to delete a GitHub release by making a DELETE request to the GitHub API.export async function deleteRelease( github_pat: string, owner: string, repo: string, release_id: number ): Promise<void> { await githubRequest( github_pat, `https://api.github.com/repos/${owner}/${repo}/releases/${release_id}`, { method: "DELETE", } ); }
- src/operations/releases.ts:82-86 (schema)Input schema for the delete_release tool, defining parameters owner, repo, and release_id.export const DeleteReleaseSchema = z.object({ owner: z.string().describe("Repository owner (username or organization)"), repo: z.string().describe("Repository name"), release_id: z.number().describe("The ID of the release") });
- src/index.ts:174-178 (registration)Registration of the delete_release tool in the MCP server's list of tools, including name, description, and input schema.{ name: "delete_release", description: "Delete a release from a GitHub repository", inputSchema: zodToJsonSchema(releases.DeleteReleaseSchema), },
- src/index.ts:551-557 (handler)Dispatcher handler in the main tool call switch statement that parses arguments and invokes the deleteRelease function.case "delete_release": { const args = releases._DeleteReleaseSchema.parse(params.arguments); await releases.deleteRelease(args.github_pat, args.owner, args.repo, args.release_id); return { content: [{ type: "text", text: JSON.stringify({ success: true }, null, 2) }], }; }