rerun_workflow
Re-run a specific GitHub Actions workflow run by specifying the repository owner, repository name, and workflow run ID to retry failed or interrupted jobs.
Instructions
Re-run a workflow run
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner (username or organization) | |
| repo | Yes | Repository name | |
| runId | Yes | The ID of the workflow run |
Implementation Reference
- src/operations/actions.ts:264-277 (handler)Handler function that executes the rerun_workflow tool by making a POST request to GitHub API's rerun endpoint for the specified workflow run.export async function rerunWorkflowRun( owner: string, repo: string, runId: number ) { owner = validateOwnerName(owner); repo = validateRepositoryName(repo); const url = `https://api.github.com/repos/${owner}/${repo}/actions/runs/${runId}/rerun`; await githubRequest(url, { method: 'POST' }); // This endpoint doesn't return any data on success return { success: true, message: `Workflow run ${runId} restarted` }; }
- src/operations/actions.ts:84-84 (schema)Schema definition for rerun_workflow input parameters, reusing CancelWorkflowRunSchema (owner, repo, runId).export const RerunWorkflowSchema = CancelWorkflowRunSchema;
- src/index.ts:226-232 (registration)Registration of the 'rerun_workflow' tool in the MCP server, linking name, schema, and handler."rerun_workflow", actions.RerunWorkflowSchema.shape, async (request: any) => { const result = await actions.rerunWorkflowRun(request.owner, request.repo, request.runId); return { content: [{ type: "text", text: JSON.stringify(result) }] }; } );
- src/operations/actions.ts:77-81 (schema)Base schema used by RerunWorkflowSchema, defining input parameters: owner, repo, runId.export const CancelWorkflowRunSchema = z.object({ owner: z.string().describe("Repository owner (username or organization)"), repo: z.string().describe("Repository name"), runId: z.number().describe("The ID of the workflow run"), });