Skip to main content
Glama
Jordan-Jarvis

Build Unblocker MCP

unblock_build

Terminate idle build executables like cl.exe or link.exe after specified idle seconds to prevent build processes from hanging. Supports custom process names and dry run mode for testing.

Instructions

Kill build executables idle > idle_seconds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dry_runNo
idle_secondsNo
process_namesNo

Implementation Reference

  • Main handler function for the 'unblock_build' tool. It examines processes matching specified names, checks if they are idle for the given duration, and kills them if not in dry-run mode. Returns a summary dictionary.
    def unblock_build(idle_seconds: int = 90,
                      process_names: t.List[str] | None = None,
                      dry_run: bool = False) -> dict:
        """
        Terminates hung build executables that are idle for a specified duration.
    
        Args:
            idle_seconds: The duration in seconds a process must be idle to be considered hung.
            process_names: A list of process names to monitor. Defaults to DEFAULT_PROCESSES.
            dry_run: If True, logs actions without actually killing processes.
    
        Returns:
            A dictionary summarizing the examination and killing of processes.
        """
        settings = Settings(idle_seconds=idle_seconds, process_names=process_names or DEFAULT_PROCESSES, dry_run=dry_run)
        examined_count = 0
        killed_count = 0
        killed_processes = []
    
        for proc in psutil.process_iter(['pid', 'name', 'create_time']):
            if proc.info['name'] in settings.process_names:
                examined_count += 1
                if is_process_idle(proc, settings.idle_seconds):
                    if settings.dry_run:
                        print(f"Dry run: Would kill process {proc.info['name']} (PID: {proc.info['pid']}) - idle for > {settings.idle_seconds}s", file=sys.stderr)
                    else:
                        try:
                            print(f"Killing process {proc.info['name']} (PID: {proc.info['pid']}) - idle for > {settings.idle_seconds}s", file=sys.stderr)
                            proc.kill()
                            killed_count += 1
                            killed_processes.append({"name": proc.info['name'], "pid": proc.info['pid']})
                        except (psutil.NoSuchProcess, psutil.AccessDenied):
                            print(f"Failed to kill process {proc.info['name']} (PID: {proc.info['pid']})", file=sys.stderr)
    
        return {
            "examined": examined_count,
            "killed": killed_count,
            "killed_processes": killed_processes,
            "timestamp": datetime.utcnow().isoformat() + "Z",
            "dry_run": settings.dry_run,
            "idle_seconds_threshold": settings.idle_seconds,
            "process_names_monitored": settings.process_names,
        }
  • MCP tool registration decorator that registers the unblock_build function with name 'unblock_build'.
    @mcp.tool(name="unblock_build", description="Kill build executables idle > idle_seconds.")
  • Helper function used by the handler to determine if a process is idle based on low CPU usage and sufficient age.
    def is_process_idle(proc: psutil.Process, idle_seconds: int) -> bool:
        """Checks if a process is idle based on CPU usage and age."""
        try:
            # Check CPU usage over a 1-second interval
            cpu_percent = proc.cpu_percent(interval=1.0)
            if cpu_percent >= 1.0:
                return False
    
            # Check process age
            create_time = proc.create_time()
            process_age = time.time() - create_time
            if process_age < idle_seconds:
                return False
    
            return True
        except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
            # Process may have exited or access denied, treat as not idle for safety
            return False
  • Default list of process names that the tool monitors for hanging builds.
    DEFAULT_PROCESSES: t.List[str] = [
        "cl.exe",
        "link.exe",
        "msbuild.exe",
        "rc.exe",
        "csc.exe",
        "devenv.exe", # Visual Studio IDE process, can also hang builds
        "cmake.exe",
        "ninja.exe",
        "make.exe",
        "gcc.exe",
        "g++.exe",
        "clang.exe",
        "clang++.exe",
    ]
  • Dataclass used internally to hold the tool's configuration settings.
    @dataclass
    class Settings:
        idle_seconds: int = 90
        process_names: t.List[str] = field(default_factory=lambda: DEFAULT_PROCESSES)
        dry_run: bool = False
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'Kill' which implies a destructive action, but doesn't specify permissions needed, side effects (e.g., data loss), error handling, or rate limits. This leaves significant gaps for a tool that terminates processes.

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 zero waste—it directly states the tool's action and condition. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 tool's complexity (destructive action with 3 parameters), no annotations, and no output schema, the description is inadequate. It doesn't cover return values, error cases, or detailed behavioral traits, leaving the agent with insufficient information for safe and effective use.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. It references 'idle_seconds' but doesn't explain the other parameters (dry_run, process_names) or provide additional context beyond the schema's titles. The description adds minimal value, barely meeting the baseline for low coverage.

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

Purpose4/5

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

The description clearly states the action ('Kill') and target ('build executables idle > idle_seconds'), providing a specific verb+resource combination. However, without sibling tools for comparison, it cannot demonstrate differentiation from alternatives, though it's not vague or tautological.

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 implies usage when build executables are idle beyond a threshold, but provides no explicit guidance on when to use this tool versus alternatives, prerequisites, or exclusions. It lacks context for decision-making in a broader workflow.

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/Jordan-Jarvis/Cpp-build-unlock-mcp'

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