github_get_workflow_run
Retrieve detailed information about a GitHub Actions workflow run, including logs if specified, using repository owner, name, and run ID inputs.
Instructions
Get detailed workflow run information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| include_logs | No | ||
| repo_name | Yes | ||
| repo_owner | Yes | ||
| run_id | Yes |
Implementation Reference
- src/mcp_server_git/github/api.py:263-327 (handler)The core handler function that implements the github_get_workflow_run tool. Fetches workflow run details and associated jobs from the GitHub Actions API, formats them with status emojis and timing information.async def github_get_workflow_run( repo_owner: str, repo_name: str, run_id: int, include_logs: bool = False ) -> str: """Get detailed workflow run information""" try: async with github_client_context() as client: # Get workflow run details run_response = await client.get( f"/repos/{repo_owner}/{repo_name}/actions/runs/{run_id}" ) if run_response.status != 200: return f"❌ Failed to get workflow run #{run_id}: {run_response.status}" run_data = await run_response.json() output = [f"Workflow Run #{run_id}:\n"] output.append(f"Name: {run_data.get('name', 'N/A')}") output.append(f"Status: {run_data.get('status', 'N/A')}") output.append(f"Conclusion: {run_data.get('conclusion', 'N/A')}") output.append(f"Branch: {run_data.get('head_branch', 'N/A')}") output.append(f"Commit: {run_data.get('head_sha', 'N/A')[:8]}") output.append(f"Started: {run_data.get('created_at', 'N/A')}") output.append(f"Updated: {run_data.get('updated_at', 'N/A')}") if run_data.get("html_url"): output.append(f"URL: {run_data['html_url']}") # Get jobs if available jobs_response = await client.get( f"/repos/{repo_owner}/{repo_name}/actions/runs/{run_id}/jobs" ) if jobs_response.status == 200: jobs_data = await jobs_response.json() jobs = jobs_data.get("jobs", []) if jobs: output.append("\nJobs:") for job in jobs: status_emoji = { "completed": "✅" if job.get("conclusion") == "success" else "❌", "in_progress": "🔄", "queued": "⏳", }.get(job["status"], "❓") output.append(f" {status_emoji} {job['name']}") output.append(f" Status: {job['status']}") if job.get("conclusion"): output.append(f" Conclusion: {job['conclusion']}") return "\n".join(output) except ValueError as auth_error: logger.error(f"Authentication error getting workflow run: {auth_error}") return f"❌ {str(auth_error)}" except ConnectionError as conn_error: logger.error(f"Connection error getting workflow run: {conn_error}") return f"❌ Network connection failed: {str(conn_error)}" except Exception as e: logger.error( f"Unexpected error getting workflow run #{run_id}: {e}", exc_info=True ) return f"❌ Error getting workflow run: {str(e)}"
- Pydantic model defining the input schema for the github_get_workflow_run tool, including required repository details and run_id, with optional include_logs flag.class GitHubGetWorkflowRun(BaseModel): repo_owner: str repo_name: str run_id: int include_logs: bool = False
- src/mcp_server_git/core/handlers.py:208-211 (registration)Registration of the tool handler in the GitToolRouter. Creates a wrapped async handler using _create_github_handler that calls the api implementation with proper argument mapping and error handling."github_get_workflow_run": self._create_github_handler( github_get_workflow_run, ["repo_owner", "repo_name", "run_id", "include_logs"], ),
- src/mcp_server_git/core/tools.py:357-364 (registration)ToolDefinition registration in the central ToolRegistry. Defines the tool metadata, schema reference, category (GITHUB), and flags for repo/token requirements. Handler placeholder later replaced by router.name=GitTools.GITHUB_GET_WORKFLOW_RUN, category=ToolCategory.GITHUB, description="Get detailed workflow run information", schema=GitHubGetWorkflowRun, handler=placeholder_handler, requires_repo=False, requires_github_token=True, ),
- src/mcp_server_git/core/tools.py:43-43 (registration)Enum definition in GitTools that provides the canonical string name for the tool used in registrations.GITHUB_GET_WORKFLOW_RUN = "github_get_workflow_run"