Skip to main content
Glama

get_commit_statuses

Fetch commit statuses for a specific repository, owner, and reference to track build, test, or deployment states directly from GitHub.

Instructions

Get statuses for a commit

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner (username or organization)
refYesThe ref (SHA, branch name, or tag name) to get statuses for
repoYesRepository name

Implementation Reference

  • The core handler function that fetches the list of commit statuses from the GitHub API for a given repository and ref (SHA, branch, or tag). It uses githubRequest utility and parses the response with Zod.
    export async function getCommitStatuses( github_pat: string, owner: string, repo: string, ref: string ): Promise<z.infer<typeof CommitStatusSchema>[]> { const response = await githubRequest( github_pat, `https://api.github.com/repos/${owner}/${repo}/commits/${ref}/statuses` ); return z.array(CommitStatusSchema).parse(response); }
  • Zod schema defining the public input parameters for the get_commit_statuses tool: owner, repo, ref.
    export const GetCommitStatusesSchema = 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 statuses for") });
  • Extended internal Zod schema that adds the required github_pat parameter for parsing tool arguments.
    export const _GetCommitStatusesSchema = GetCommitStatusesSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });
  • src/index.ts:216-220 (registration)
    Tool registration in the listTools response, defining name, description, and input schema (converted to JSON schema).
    { name: "get_commit_statuses", description: "Get statuses for a commit", inputSchema: zodToJsonSchema(statuses.GetCommitStatusesSchema), },
  • src/index.ts:629-636 (registration)
    Dispatch handler in the main switch statement for CallToolRequest that parses arguments with the extended schema and calls the core getCommitStatuses function.
    case "get_commit_statuses": { const args = statuses._GetCommitStatusesSchema.parse(params.arguments); const { github_pat, owner, repo, ref } = args; const result = await statuses.getCommitStatuses(github_pat, owner, repo, ref); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }

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