get_workflow
Retrieve details of a specific GitHub Actions workflow by providing the repository owner, repo name, and workflow ID or filename. Use this tool to manage and monitor workflow execution status and configurations directly through the GitHub API.
Instructions
Get details of a specific workflow
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | Repository owner (username or organization) | |
| repo | Yes | Repository name | |
| workflowId | Yes | The ID of the workflow or filename |
Implementation Reference
- src/operations/actions.ts:110-121 (handler)The core handler function that fetches a specific GitHub workflow by owner, repo, and workflowId using the GitHub API and parses the response with WorkflowSchema.export async function getWorkflow( owner: string, repo: string, workflowId: string | number ) { owner = validateOwnerName(owner); repo = validateRepositoryName(repo); const url = `https://api.github.com/repos/${owner}/${repo}/actions/workflows/${workflowId}`; const response = await githubRequest(url); return WorkflowSchema.parse(response); }
- src/operations/actions.ts:25-29 (schema)Zod schema defining the input parameters for the get_workflow tool: owner, repo, and workflowId.export const GetWorkflowSchema = z.object({ owner: z.string().describe("Repository owner (username or organization)"), repo: z.string().describe("Repository name"), workflowId: z.string().describe("The ID of the workflow or filename (string or number)"), });
- src/index.ts:160-166 (registration)MCP server registration of the 'get_workflow' tool, providing the schema and a wrapper handler that calls the core getWorkflow function and formats the response."get_workflow", actions.GetWorkflowSchema.shape, async (request: any) => { const result = await actions.getWorkflow(request.owner, request.repo, request.workflowId); return { content: [{ type: "text", text: JSON.stringify(result) }] }; } );