Skip to main content
Glama
ko1ynnky

GitHub Actions MCP Server

by ko1ynnky

cancel_workflow_run

Cancel a running GitHub Actions workflow to stop resource usage and prevent unnecessary execution when changes are needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner (username or organization)
repoYesRepository name
runIdYesThe ID of the workflow run

Implementation Reference

  • The handler function that executes the cancellation by POSTing to GitHub API endpoint /actions/runs/{runId}/cancel, validates owner/repo, returns success message.
    export async function cancelWorkflowRun( owner: string, repo: string, runId: number ) { owner = validateOwnerName(owner); repo = validateRepositoryName(repo); const url = `https://api.github.com/repos/${owner}/${repo}/actions/runs/${runId}/cancel`; await githubRequest(url, { method: 'POST' }); // This endpoint doesn't return any data on success return { success: true, message: `Workflow run ${runId} cancelled` }; }
  • Zod input schema defining parameters: owner (string), repo (string), runId (number).
    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"), });
  • src/index.ts:216-223 (registration)
    MCP server.tool registration of 'cancel_workflow_run' tool, providing schema and async handler wrapper that calls the actions.cancelWorkflowRun and formats response.
    server.tool( "cancel_workflow_run", actions.CancelWorkflowRunSchema.shape, async (request: any) => { const result = await actions.cancelWorkflowRun(request.owner, request.repo, request.runId); return { content: [{ type: "text", text: JSON.stringify(result) }] }; } );

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

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