Skip to main content
Glama

prioritize_survivors

Prioritize surviving mutants by materiality, filtering log-only changes and ranking by potential impact to identify critical test gaps.

Instructions

Prioritize surviving mutants by likely materiality, filtering out log/debug-only changes and ranking by potential impact. Returns a sorted list of survivors with reasons for prioritization.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
venv_pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for 'prioritize_survivors' tool, which processes survivor information and returns a prioritized list based on a simple heuristic.
    def prioritize_survivors(venv_path: Optional[str] = None) -> dict:
        """
        Prioritize surviving mutants by likely materiality, filtering out log/debug-only changes and ranking by potential impact.
        Returns a sorted list of survivors with reasons for prioritization.
        """
        survivors_output = show_survivors(venv_path)
        if not survivors_output or "no surviving mutants" in survivors_output.lower():
            return {"prioritized": [], "message": "No surviving mutants found."}
        prioritized = []
        for line in survivors_output.splitlines():
            if not line.strip() or line.startswith("SURVIVED:") is False:
                continue
            # Example line: SURVIVED: mypackage.module.function_name:42 (some description)
            mutant_id = line.split(":", 1)[-1].strip()
            # Heuristic: deprioritize if log/debug, prioritize if in core logic
            if any(kw in line.lower() for kw in ["log", "debug", "print", "logger", "logging"]):
                reason = "Likely log/debug only, deprioritized."
                score = 0
            else:
                reason = "Potentially material logic, prioritize."
                score = 1
            prioritized.append({"mutant_id": mutant_id, "score": score, "reason": reason, "raw": line})
        # Sort by score descending (material first)
        prioritized.sort(key=lambda x: x["score"], reverse=True)
        return {"prioritized": prioritized, "message": "Survivors prioritized by likely materiality."}
  • mutmut_mcp.py:188-188 (registration)
    Tool registration for 'prioritize_survivors' using the MCP decorator.
    mcp.tool()(prioritize_survivors)
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions the tool's behavior (filtering and ranking) and output (sorted list with reasons), but lacks details on permissions, rate limits, side effects, or error handling. For a tool with no annotation coverage, this is a significant gap in behavioral disclosure.

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 front-loaded and efficient, consisting of two sentences that directly convey the tool's purpose and output without unnecessary details. Every sentence adds value, making it appropriately sized and well-structured.

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

Completeness4/5

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

Given the tool's complexity (analysis and ranking), no annotations, and an output schema exists, the description is reasonably complete. It explains what the tool does and the output format, but could benefit from more behavioral context (e.g., how prioritization is determined). The presence of an output schema reduces the need to detail return values.

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?

The input schema has 1 parameter with 0% description coverage, and the tool description does not mention any parameters. Since schema_description_coverage is low (<50%), the description does not compensate by explaining the 'venv_path' parameter. However, with 0 parameters documented in the description, the baseline is 4, but it's reduced to 3 due to the lack of any parameter information despite the schema gap.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('prioritize', 'filtering out', 'ranking') and resources ('surviving mutants'), distinguishing it from siblings like show_survivors or show_results by emphasizing analysis rather than display. It explicitly mentions the criteria (likely materiality, log/debug-only changes, potential impact) and the output format (sorted list with reasons).

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

Usage Guidelines3/5

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

The description implies usage by mentioning 'surviving mutants', suggesting it should be used after mutation testing, but it does not explicitly state when to use this tool versus alternatives like show_survivors or rerun_mutmut_on_survivor. No exclusions or prerequisites are provided, leaving the context somewhat vague.

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

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/wdm0006/mutmut-mcp'

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