Skip to main content
Glama
MementoRC

MCP Git Server

by MementoRC

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
NameRequiredDescriptionDefault
include_logsNo
repo_nameYes
repo_ownerYes
run_idYes

Implementation Reference

  • 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
  • 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"],
    ),
  • 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,
    ),
  • Enum definition in GitTools that provides the canonical string name for the tool used in registrations.
    GITHUB_GET_WORKFLOW_RUN = "github_get_workflow_run"
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a 'Get' operation (implying read-only), but doesn't specify authentication requirements, rate limits, error conditions, or what 'detailed information' includes (e.g., status, duration, artifacts). For a tool with 4 parameters and no annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core purpose ('Get detailed workflow run information'), making it easy to parse. Every part of the sentence contributes meaning, adhering to conciseness principles.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (4 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what information is returned, how to interpret results, or address key behavioral aspects like authentication or error handling. For a tool that likely interacts with GitHub's API, this leaves too much undefined for effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the schema provides no parameter descriptions. The tool description adds no information about parameters beyond what's inferred from their names (e.g., 'repo_owner', 'run_id'). It doesn't explain what 'include_logs' entails, format expectations for 'repo_name', or how to obtain a 'run_id'. With 4 parameters and no schema descriptions, the description fails to compensate for this gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get detailed workflow run information' states the verb ('Get') and resource ('workflow run information'), making the basic purpose clear. However, it's vague about what 'detailed' entails and doesn't distinguish this tool from potential siblings like 'github_get_pr_checks' or 'github_get_failing_jobs' that might also retrieve workflow-related data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a specific run_id), exclusions, or comparisons to sibling tools like 'github_get_failing_jobs' or 'github_get_pr_status' that might overlap in functionality. Usage is implied only by the tool name.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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/MementoRC/mcp-git'

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