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) }],
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states 'Create' implying a write/mutation operation, but lacks details on permissions required, rate limits, whether it's idempotent, or what happens on failure. The description adds minimal behavioral context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose with a clarifying example. There's no wasted verbiage or redundancy, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 7 parameters, no annotations, and no output schema, the description is insufficient. It doesn't cover authentication needs, error handling, response format, or how it interacts with sibling tools like 'get_commit_statuses'. More context is needed for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are well-documented in the schema. The description adds no additional parameter semantics beyond implying 'state' includes values like 'passed/failed' (which aligns with the enum). Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a status') and resource ('for a commit'), with examples of status types ('build passed/failed, etc.'). It distinguishes from siblings like 'get_commit_statuses' (read vs. write) but doesn't explicitly differentiate from all siblings like 'create_issue' or 'create_release'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives is provided. The description doesn't mention prerequisites (e.g., authentication needs), when not to use it, or refer to related tools like 'get_commit_statuses' for checking existing statuses.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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