Skip to main content
Glama
piyushgIITian

GitHub Enterprise MCP Server

list-workflow-runs

Retrieve and filter GitHub workflow runs by status, branch, or workflow ID to monitor CI/CD pipeline execution and track build statuses.

Instructions

List workflow runs in a GitHub repository

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
branchNoFilter by branch name
ownerYesRepository owner
pageNoPage number
perPageNoItems per page
repoYesRepository name
statusNoFilter by run status
workflow_idNoWorkflow ID or file name

Implementation Reference

  • The primary handler function that parses input using ListWorkflowRunsSchema, calls GitHub Actions API to list workflow runs (either for a specific workflow or all in repo), and formats the response.
    export async function listWorkflowRuns(args: unknown): Promise<any> {
      const { owner, repo, workflow_id, branch, status, page, perPage } = ListWorkflowRunsSchema.parse(args);
      const github = getGitHubApi();
    
      return tryCatchAsync(async () => {
        let data;
    
        if (workflow_id) {
          // List runs for a specific workflow
          const response = await github.getOctokit().actions.listWorkflowRuns({
            owner,
            repo,
            workflow_id,
            branch,
            status: status as any,
            page,
            per_page: perPage,
          });
          data = response.data;
        } else {
          // List all workflow runs
          const response = await github.getOctokit().actions.listWorkflowRunsForRepo({
            owner,
            repo,
            branch,
            status: status as any,
            page,
            per_page: perPage,
          });
          data = response.data;
        }
    
        return {
          total_count: data.total_count,
          workflow_runs: data.workflow_runs.map((run) => ({
            id: run.id,
            name: run.name,
            workflow_id: run.workflow_id,
            head_branch: run.head_branch,
            head_sha: run.head_sha,
            run_number: run.run_number,
            event: run.event,
            status: run.status,
            conclusion: run.conclusion,
            created_at: run.created_at,
            updated_at: run.updated_at,
            url: run.html_url,
          })),
        };
      }, 'Failed to list workflow runs');
    }
  • Zod schema for validating the input arguments to the listWorkflowRuns handler, extending OwnerRepoSchema with optional workflow_id, branch, status enum, page, and perPage.
    export const ListWorkflowRunsSchema = OwnerRepoSchema.extend({
      workflow_id: z.union([z.string(), z.number()]).optional(),
      branch: z.string().optional(),
      status: z
        .enum([
          'completed',
          'action_required',
          'cancelled',
          'failure',
          'neutral',
          'skipped',
          'stale',
          'success',
          'timed_out',
          'in_progress',
          'queued',
          'requested',
          'waiting',
        ])
        .optional(),
      page: z.number().int().optional(),
      perPage: z.number().int().optional(),
    });
  • src/server.ts:302-355 (registration)
    MCP tool registration entry in server.tools.add array, defining the tool name, description, and inputSchema matching the handler validation.
    {
      name: 'list-workflow-runs',
      description: 'List workflow runs in a GitHub repository',
      inputSchema: {
        type: 'object',
        properties: {
          owner: {
            type: 'string',
            description: 'Repository owner',
          },
          repo: {
            type: 'string',
            description: 'Repository name',
          },
          workflow_id: {
            type: ['string', 'number'],
            description: 'Workflow ID or file name',
          },
          branch: {
            type: 'string',
            description: 'Filter by branch name',
          },
          status: {
            type: 'string',
            enum: [
              'completed',
              'action_required',
              'cancelled',
              'failure',
              'neutral',
              'skipped',
              'stale',
              'success',
              'timed_out',
              'in_progress',
              'queued',
              'requested',
              'waiting',
            ],
            description: 'Filter by run status',
          },
          page: {
            type: 'integer',
            description: 'Page number',
          },
          perPage: {
            type: 'integer',
            description: 'Items per page',
          },
        },
        required: ['owner', 'repo'],
        additionalProperties: false,
      },
    },
  • Switch case in the CallToolRequestHandler that dispatches tool calls named 'list-workflow-runs' to the listWorkflowRuns handler function.
    case 'list-workflow-runs':
      result = await listWorkflowRuns(parsedArgs);
      break;
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the basic action but doesn't mention pagination behavior (implied by page/perPage parameters), rate limits, authentication requirements, or what the output format looks like. For a list operation with 7 parameters, this leaves significant behavioral gaps.

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 states the core purpose without unnecessary words. It's appropriately sized for a straightforward list operation and gets directly to the point with zero wasted verbiage.

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 tool with 7 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain the filtering capabilities (branch, status, workflow_id), pagination behavior, or what information is returned. The agent would need to rely heavily on the schema and trial-and-error to use this tool effectively.

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?

The schema description coverage is 100%, meaning all parameters are documented in the schema itself. The description adds no additional parameter information beyond what's already in the schema. According to the rules, when schema coverage is high (>80%), the baseline score is 3 even with no param info in the description.

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 ('List') and resource ('workflow runs in a GitHub repository'), making the purpose immediately understandable. However, it doesn't distinguish this tool from similar sibling tools like 'list-workflows' or 'list-issues', which would require more specific differentiation to earn a 5.

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?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of when this tool is appropriate, what prerequisites might exist, or how it differs from related tools like 'list-workflows' or 'trigger-workflow'. The agent must infer usage from the name alone.

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/piyushgIITian/github-enterprice-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server