VX Agents

API directory · Developer Tools

GitHub Actions Workflow Runs

v1.0.0 · 13 endpoints · 0 connections · shared by vx.ai

When a build goes red, find the failing GitHub Actions run, open its jobs and read the job log to see which step broke, then re-run only the failed jobs, cancel a stuck run, or start a workflow_dispatch workflow on another branch. Artifacts from each run are listed too.

Connect this API to an AI agent Browse all specs

What you can do with GitHub Actions Workflow Runs via MCP

Every endpoint below becomes a governed tool your AI agent (Claude, ChatGPT, or a customer-facing VX agent) can call — with scoped permissions, sandbox testing, and audit logs.

MethodPathOperationDescription
GET /repos/{owner}/{repo}/actions/workflows listWorkflows List the workflows defined in a repository
GET /repos/{owner}/{repo}/actions/workflows/{workflow_id} getWorkflow Get a workflow by id or file name
GET /repos/{owner}/{repo}/actions/runs listWorkflowRuns List recent runs filtered by branch, status, event or commit
GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs listRunsForWorkflow List runs of one workflow
GET /repos/{owner}/{repo}/actions/runs/{run_id} getWorkflowRun Get a run's status, conclusion, branch and commit
GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs listJobsForRun List a run's jobs and their steps
GET /repos/{owner}/{repo}/actions/jobs/{job_id} getJob Get one job with step results and runner
GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs downloadJobLogs Get a download link for a job's plain-text log
GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts listRunArtifacts List the artifacts a run uploaded
POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs rerunFailedJobs Re-run only the failed jobs of a run
POST /repos/{owner}/{repo}/actions/runs/{run_id}/rerun rerunWorkflow Re-run every job of a run
POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel cancelWorkflowRun Cancel a queued or running run
POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches dispatchWorkflow Start a workflow_dispatch workflow on a branch or tag

Authentication

github_token

Bearer token — sent as Authorization: Bearer <token>

GitHub fine-grained personal access token (or a GitHub App installation token), sent as Authorization: Bearer <token>.

How to get a credential

  1. On GitHub, open Settings > Developer settings > Personal access tokens > Fine-grained tokens and click Generate new token.
  2. Pick the resource owner (you or the organization) and the repositories the agent may touch.
  3. Under Repository permissions, set Actions to Read and write (Read-only is enough if you will not re-run, cancel or dispatch). Metadata read is added automatically.
  4. Generate the token and copy it (github_pat_...). Organizations may need to approve it.

Permissions used

Permission Operations
Actions: read listWorkflows, getWorkflow, listWorkflowRuns, listRunsForWorkflow, getWorkflowRun, listJobsForRun, getJob, downloadJobLogs, listRunArtifacts
Actions: write rerunWorkflow, rerunFailedJobs, cancelWorkflowRun, dispatchWorkflow

Common errors

Status Meaning Fix
401 Token missing, expired or revoked Generate a new token and update the credential.
403 Permission missing, token not approved by the org, or rate limit Give the token Actions access to this repository; wait if x-ratelimit-remaining is 0.
404 Repository or run not visible to the token Check owner/repo and that the token covers the repository.
422 Bad dispatch input or workflow lacks workflow_dispatch Send a valid ref and only the inputs the workflow defines.
429 Secondary rate limit Slow down and retry after the retry-after header.

Store the token as a VX Agents credential (Bearer token).

Usage guide

Setup

  1. Add a GitHub fine-grained token as a VX Agents Bearer credential, with repository permission Actions (read and write) on the repositories you want covered.
  2. Every call pins X-GitHub-Api-Version: 2022-11-28.
  3. Worth pinning: owner and repo when the agent works on one repository.

Triage a failing build

  1. listWorkflowRuns with status=failure (or branch, event, head_sha, created=>=2026-10-01) to find the run; listRunsForWorkflow narrows to one workflow (id or file name such as ci.yml, from listWorkflows).
  2. getWorkflowRun for status, conclusion, head_branch, head_sha and run_attempt.
  3. listJobsForRun (filter=latest) shows each job and its steps with conclusion; pick the failed job. getJob gives one job in detail.
  4. downloadJobLogs returns a short-lived link (HTTP 302 Location) to the plain-text log; read the lines around the failed step.
  5. listRunArtifacts lists test reports or builds the run uploaded (archive_download_url).
  6. To retry, tell the user what will run and confirm, then rerunFailedJobs (only failed jobs and their dependents) or rerunWorkflow (all jobs). Add {"enable_debug_logging": true} for more detail.
  7. To stop a stuck run, confirm, then cancelWorkflowRun.

Start a workflow by hand

  1. getWorkflow to check it exists and is active; the workflow file must have a workflow_dispatch trigger.
  2. Confirm branch and inputs with the user, then dispatchWorkflow with {"ref": "main", "inputs": {"environment": "staging"}}. Only send inputs the workflow defines (at most 25).
  3. listRunsForWorkflow with event=workflow_dispatch to follow the new run.

Good to know

  • Run status values: queued, in_progress, completed; when completed, conclusion is success, failure, cancelled, skipped or timed_out.
  • Lists page with per_page (max 100) and page; run lists return at most 1,000 results per query, so filter by created.
  • Log links expire after about a minute; fetch them right away.
  • Re-runs, cancels and dispatches use CI minutes and can deploy code: always confirm first. Disabling workflows and deleting runs or logs are not part of this spec.

Source: GitHub REST API reference for Actions workflows, workflow runs, jobs and artifacts (https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28), checked 2026-10-20.

How to use this spec

  1. Create a free VX Agents account (sandbox tools included).
  2. Open the marketplace and connect “GitHub Actions Workflow Runs” to an agent.
  3. Expose it as an MCP server for Claude/ChatGPT, or chat with it directly.

Related APIs