get_combined_status
Retrieve the combined status of a commit in a GitHub repository by specifying the owner, repository name, and reference (SHA, branch, or tag).
Instructions
Get the combined status for a commit
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner (username or organization) | |
| ref | Yes | The ref (SHA, branch name, or tag name) to get the combined status for | |
| repo | Yes | Repository name |
Implementation Reference
- src/operations/statuses.ts:107-119 (handler)The main handler function that executes the tool logic: fetches the combined commit status from the GitHub API endpoint /repos/{owner}/{repo}/commits/{ref}/status and validates the response using CombinedStatusResponseSchema.export async function getCombinedStatus( github_pat: string, owner: string, repo: string, ref: string ): Promise<z.infer<typeof CombinedStatusResponseSchema>> { const response = await githubRequest( github_pat, `https://api.github.com/repos/${owner}/${repo}/commits/${ref}/status` ); return CombinedStatusResponseSchema.parse(response); }
- src/operations/statuses.ts:44-52 (schema)Input schema definitions: GetCombinedStatusSchema (public input) and _GetCombinedStatusSchema (internal with github_pat).export const GetCombinedStatusSchema = z.object({ owner: z.string().describe("Repository owner (username or organization)"), repo: z.string().describe("Repository name"), ref: z.string().describe("The ref (SHA, branch name, or tag name) to get the combined status for") }); export const _GetCombinedStatusSchema = GetCombinedStatusSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });
- src/operations/statuses.ts:94-105 (schema)Output schema for the combined status response from GitHub API.export const CombinedStatusResponseSchema = z.object({ state: z.string(), statuses: z.array(CommitStatusSchema), sha: z.string(), total_count: z.number(), repository: z.object({ id: z.number(), name: z.string(), full_name: z.string(), owner: z.any(), }), });
- src/index.ts:221-225 (registration)Tool registration in the ListTools response: defines name, description, and input schema.{ name: "get_combined_status", description: "Get the combined status for a commit", inputSchema: zodToJsonSchema(statuses.GetCombinedStatusSchema), },
- src/index.ts:638-645 (registration)Dispatch logic in the CallToolRequest handler: parses arguments using _GetCombinedStatusSchema and invokes the getCombinedStatus function.case "get_combined_status": { const args = statuses._GetCombinedStatusSchema.parse(params.arguments); const { github_pat, owner, repo, ref } = args; const result = await statuses.getCombinedStatus(github_pat, owner, repo, ref); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }