clean_mutmut_cache
Remove cached mutation test data to ensure accurate results and free up disk space by clearing the .mutmut-cache file or using the mutmut CLI.
Instructions
Clean mutmut cache using the mutmut CLI (if available), otherwise remove .mutmut-cache file. Returns the plain text output or confirmation message.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| venv_path | No |
Implementation Reference
- mutmut_mcp.py:120-138 (handler)The clean_mutmut_cache function attempts to clear the mutmut cache using the CLI 'clean' command, falling back to manual file deletion if necessary.
def clean_mutmut_cache(venv_path: Optional[str] = None) -> str: """ Clean mutmut cache using the mutmut CLI (if available), otherwise remove .mutmut-cache file. Returns the plain text output or confirmation message. """ # Try CLI first result = _run_mutmut_cli(["clean"], venv_path) if "Error" not in result: return result # Fallback: remove .mutmut-cache file try: if os.path.exists(MUTMUT_CACHE_PATH): os.remove(MUTMUT_CACHE_PATH) return "Mutmut cache cleared successfully." else: return "No mutmut cache found to clear." except Exception as e: return f"Failed to clear mutmut cache: {str(e)}" - mutmut_mcp.py:186-186 (registration)Registration of the clean_mutmut_cache tool with the FastMCP server.
mcp.tool()(clean_mutmut_cache)