Skip to main content
Glama
onemarc

GitHub Actions MCP Server

by onemarc

list_workflow_runs

Retrieve and filter workflow runs for a GitHub repository by owner, repo, workflow ID, actor, branch, event, status, or creation date. Supports pagination and excluding PR-triggered runs.

Instructions

List all workflow runs for a repository or specific workflow

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actorNoFilter by user who triggered the workflow
branchNoFilter by branch
checkSuiteIdNoFilter by check suite ID
createdNoFilter by creation date (YYYY-MM-DD)
eventNoFilter by event type
excludePullRequestsNoExclude PR-triggered runs
ownerYesRepository owner
pageNoPage number for pagination
perPageNoResults per page (max 100)
repoYesRepository name
statusNoFilter by status
workflowIdNoThe ID of the workflow or filename

Implementation Reference

  • The handler function that executes the tool logic, fetching workflow runs from GitHub API using Octokit based on provided filters.
    const handleListWorkflowRuns: ToolHandler = async (args, octokit: Octokit) => {
      const { 
        owner, 
        repo, 
        workflowId, 
        actor, 
        branch, 
        event, 
        status, 
        created, 
        excludePullRequests, 
        checkSuiteId, 
        page, 
        perPage 
      } = args;
      
      try {
        const params: any = {
          owner,
          repo,
          page,
          per_page: perPage
        };
    
        if (actor) params.actor = actor;
        if (branch) params.branch = branch;
        if (event) params.event = event;
        if (status) params.status = status;
        if (created) params.created = created;
        if (excludePullRequests !== undefined) params.exclude_pull_requests = excludePullRequests;
        if (checkSuiteId) params.check_suite_id = checkSuiteId;
    
        let response;
        if (workflowId) {
          response = await octokit.rest.actions.listWorkflowRuns({
            ...params,
            workflow_id: workflowId
          });
        } else {
          response = await octokit.rest.actions.listWorkflowRunsForRepo(params);
        }
    
        return {
          total_count: response.data.total_count,
          workflow_runs: response.data.workflow_runs.map(run => ({
            id: run.id,
            name: run.name,
            head_branch: run.head_branch,
            head_sha: run.head_sha,
            status: run.status,
            conclusion: run.conclusion,
            workflow_id: run.workflow_id,
            created_at: run.created_at,
            updated_at: run.updated_at,
            run_number: run.run_number,
            event: run.event,
            actor: run.actor,
            html_url: run.html_url
          }))
        };
      } catch (error: any) {
        throw new WorkflowError(`Failed to list workflow runs: ${error.message}`, error.response?.data);
      }
    };
  • The tool definition object containing the name, description, and inputSchema for validating tool inputs.
    {
      name: "list_workflow_runs",
      description: "List all workflow runs for a repository or specific workflow",
      inputSchema: {
        type: "object",
        properties: {
          owner: { type: "string", description: "Repository owner" },
          repo: { type: "string", description: "Repository name" },
          workflowId: { 
            oneOf: [
              { type: "string" },
              { type: "number" }
            ],
            description: "The ID of the workflow or filename"
          },
          actor: { type: "string", description: "Filter by user who triggered the workflow" },
          branch: { type: "string", description: "Filter by branch" },
          event: { type: "string", description: "Filter by event type" },
          status: { 
            type: "string", 
            enum: ["completed", "action_required", "cancelled", "failure", "neutral", "skipped", "stale", "success", "timed_out", "in_progress", "queued", "requested", "waiting"],
            description: "Filter by status"
          },
          created: { type: "string", description: "Filter by creation date (YYYY-MM-DD)" },
          excludePullRequests: { type: "boolean", description: "Exclude PR-triggered runs" },
          checkSuiteId: { type: "number", description: "Filter by check suite ID" },
          page: { type: "number", description: "Page number for pagination" },
          perPage: { type: "number", description: "Results per page (max 100)" }
        },
        required: ["owner", "repo"]
      }
  • Registration of all tool handlers in a map, mapping 'list_workflow_runs' to its handler function.
    export const toolHandlers: Record<string, ToolHandler> = {
      create_workflow: handleCreateWorkflow,
      list_workflows: handleListWorkflows,
      get_workflow: handleGetWorkflow,
      get_workflow_usage: handleGetWorkflowUsage,
      list_workflow_runs: handleListWorkflowRuns,
      get_workflow_run: handleGetWorkflowRun,
      get_workflow_run_jobs: handleGetWorkflowRunJobs,
      trigger_workflow: handleTriggerWorkflow,
      cancel_workflow_run: handleCancelWorkflowRun,
      rerun_workflow: handleRerunWorkflow,
    };
  • src/tools/index.ts:7-7 (registration)
    Import of the handler function for list_workflow_runs.
    import handleListWorkflowRuns from './list-workflow-runs.js';
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 mentions listing but doesn't disclose behavioral traits like pagination behavior (implied by 'page' and 'perPage' params), rate limits, authentication requirements, or response format. For a read operation with many parameters, this lacks critical 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 action and scope. It wastes no words and is appropriately sized for a list operation, making it easy for an AI agent 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?

Given high complexity (12 parameters, no output schema, no annotations), the description is incomplete. It doesn't explain return values, pagination, error handling, or authentication needs. For a tool with extensive filtering options and sibling tools, more context is needed to guide 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 specific parameter semantics beyond implying filtering capabilities ('for a repository or specific workflow'), which the schema already covers in detail. Baseline 3 is appropriate as the schema does the heavy lifting, but the description doesn't compensate with additional insights.

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 verb ('List') and resource ('workflow runs'), specifying scope ('for a repository or specific workflow'). It distinguishes from siblings like 'get_workflow_run' (singular) and 'list_workflows' (workflows, not runs), but doesn't explicitly differentiate from 'get_workflow_run_jobs' which focuses on jobs within runs. The purpose is specific but could be more precise about sibling distinctions.

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. It doesn't mention prerequisites like authentication, compare to 'list_workflows' for listing workflow definitions, or specify scenarios like filtering needs. With 12 parameters for filtering, usage context is implied but not stated, leaving gaps for an AI agent.

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

Related 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/onemarc/github-actions-mcp-server'

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