remove_skill
Remove a skill from Friday MCP Server while automatically preserving a rollback backup for recovery.
Instructions
Remove a skill and keep a rollback backup.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| skill_id | Yes |
Implementation Reference
- The MCP tool handler for 'remove_skill'. Decorated with @mcp.tool(), it delegates to skill_store.remove_skill().
@mcp.tool() def remove_skill(skill_id: str) -> dict: """Remove a skill and keep a rollback backup.""" return skill_store.remove_skill(skill_id) - The core business logic for remove_skill. Loads the registry, validates the skill exists, moves the file to a timestamped backup, removes the registry entry, and returns removal status with backup path.
def remove_skill(self, skill_id: str) -> dict[str, Any]: registry = self._load_registry() record = registry.get(skill_id) if record is None: raise SkillError(f"Unknown skill '{skill_id}'.") skill_path = Path(record["path"]) removed = skill_path.exists() if removed: timestamp = self._timestamp_slug() backup_path = self.backups_dir / f"{skill_id}-{timestamp}.md" shutil.move(str(skill_path), backup_path) record["backup_path"] = str(backup_path) registry.pop(skill_id) self._save_registry(registry) return { "removed": removed, "skill_id": skill_id, "backup_path": record.get("backup_path"), } - src/friday_mcp_server/tools/skills.py:10-11 (registration)The 'register' function in skills.py registers all skill tools including remove_skill via the @mcp.tool() decorator on line 63.
def register(mcp, *, skill_store) -> None: @mcp.tool() - src/friday_mcp_server/tools/__init__.py:11-11 (registration)The register_all_tools function calls skills.register(mcp, skill_store=skill_store), which registers all skill tools including remove_skill.
skills.register(mcp, skill_store=skill_store) - The _timestamp_slug helper used to generate unique backup filenames (e.g., 'my-skill-20250101T120000Z.md').
def _timestamp_slug(self) -> str: return datetime.now(UTC).strftime("%Y%m%dT%H%M%SZ")