list_releases
Retrieve GitHub repository releases by specifying owner, repo, and pagination options. Ideal for tracking and managing release versions effectively.
Instructions
List releases for a GitHub repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner (username or organization) | |
| page | No | Page number of the results | |
| per_page | No | Results per page (max 100) | |
| repo | Yes | Repository name |
Implementation Reference
- src/operations/releases.ts:145-158 (handler)Core handler function that queries the GitHub Releases API to list releases for a repository, supporting pagination.export async function listReleases( github_pat: string, owner: string, repo: string, options: { per_page?: number; page?: number } = {} ): Promise<z.infer<typeof ReleaseSchema>[]> { const url = new URL(`https://api.github.com/repos/${owner}/${repo}/releases`); if (options.per_page) url.searchParams.append("per_page", options.per_page.toString()); if (options.page) url.searchParams.append("page", options.page.toString()); const response = await githubRequest(github_pat, url.toString()); return z.array(ReleaseSchema).parse(response); }
- src/operations/releases.ts:71-76 (schema)Input schema for the list_releases tool defining parameters: owner, repo, per_page, page.export const ListReleasesSchema = z.object({ owner: z.string().describe("Repository owner (username or organization)"), repo: z.string().describe("Repository name"), per_page: z.number().optional().describe("Results per page (max 100)"), page: z.number().optional().describe("Page number of the results") });
- src/index.ts:169-173 (registration)Tool registration in the server's listTools handler, specifying name, description, and input schema.{ name: "list_releases", description: "List releases for a GitHub repository", inputSchema: zodToJsonSchema(releases.ListReleasesSchema), },
- src/index.ts:542-549 (registration)Dispatch handler in the CallToolRequest switch statement that parses arguments and invokes the listReleases function.case "list_releases": { const args = releases._ListReleasesSchema.parse(params.arguments); const { github_pat, owner, repo, ...options } = args; const result = await releases.listReleases(github_pat, owner, repo, options); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }
- src/operations/releases.ts:78-80 (schema)Extended internal schema used for parsing tool arguments, including the github_pat.export const _ListReleasesSchema = ListReleasesSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });