Skip to main content
Glama

create_commit_status

Set commit statuses (success, failure, pending, error) in GitHub repositories to track build results and deployment states.

Instructions

Create a status for a commit (build passed/failed, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner (username or organization)
repoYesRepository name
shaYesThe SHA of the commit to create a status for
stateYesThe state of the status
target_urlNoThe target URL to associate with this status
descriptionNoA short description of the status
contextNoA string label to differentiate this status from others

Implementation Reference

  • Core handler function that executes the tool logic: sends POST request to GitHub API to create a commit status and parses the response.
    export async function createCommitStatus( github_pat: string, owner: string, repo: string, sha: string, state: "error" | "failure" | "pending" | "success", options: { target_url?: string; description?: string; context?: string; } = {} ): Promise<z.infer<typeof CommitStatusSchema>> { const response = await githubRequest( github_pat, `https://api.github.com/repos/${owner}/${repo}/statuses/${sha}`, { method: "POST", body: { state, ...options, }, } ); return CommitStatusSchema.parse(response); }
  • Input schema definition for the create_commit_status tool (used in tool registration).
    export const CreateCommitStatusSchema = z.object({ owner: z.string().describe("Repository owner (username or organization)"), repo: z.string().describe("Repository name"), sha: z.string().describe("The SHA of the commit to create a status for"), state: z.enum(["error", "failure", "pending", "success"]).describe("The state of the status"), target_url: z.string().optional().describe("The target URL to associate with this status"), description: z.string().optional().describe("A short description of the status"), context: z.string().optional().describe("A string label to differentiate this status from others") });
  • Extended input schema including github_pat (used for parsing arguments in the dispatcher).
    export const _CreateCommitStatusSchema = CreateCommitStatusSchema.extend({ github_pat: z.string().describe("GitHub Personal Access Token"), });
  • src/index.ts:212-215 (registration)
    Tool registration in the list_tools handler, defining name, description, and input schema.
    name: "create_commit_status", description: "Create a status for a commit (build passed/failed, etc.)", inputSchema: zodToJsonSchema(statuses.CreateCommitStatusSchema), },
  • Dispatcher case in the main CallToolRequest handler that parses args and delegates to the core implementation.
    case "create_commit_status": { const args = statuses._CreateCommitStatusSchema.parse(params.arguments); const { github_pat, owner, repo, sha, state, ...options } = args; const result = await statuses.createCommitStatus(github_pat, owner, repo, sha, state, options); 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