browse_mode_library
Filter and explore the Mode Manager MCP Library by category or search term to efficiently locate and manage VS Code chat modes and instructions.
Instructions
Browse the Mode Manager MCP Library and filter by category or search term.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | ||
| search | No |
Implementation Reference
- The handler function that implements the core logic of the 'browse_mode_library' tool. It filters and formats the library contents into a user-friendly string response.def browse_mode_library( category: Annotated[Optional[str], "Optional category filter"] = None, search: Annotated[Optional[str], "Optional search term"] = None, ) -> str: """Browse the Mode Manager MCP Library and filter by category or search term.""" try: library_data = library_manager.browse_library(category=category, search=search) result = f"Library: {library_data['library_name']} (v{library_data['version']})\n" result += f"Last Updated: {library_data['last_updated']}\n" result += f"Total: {library_data['total_chatmodes']} chatmodes, {library_data['total_instructions']} instructions\n" if library_data["filters_applied"]["category"] or library_data["filters_applied"]["search"]: result += f"Filtered: {library_data['filtered_chatmodes']} chatmodes, {library_data['filtered_instructions']} instructions\n" filters = [] if library_data["filters_applied"]["category"]: filters.append(f"category: {library_data['filters_applied']['category']}") if library_data["filters_applied"]["search"]: filters.append(f"search: {library_data['filters_applied']['search']}") result += f" Filters applied: {', '.join(filters)}\n" result += "\n" chatmodes = library_data["chatmodes"] if chatmodes: result += f"CHATMODES ({len(chatmodes)} available):\n\n" for cm in chatmodes: result += f"{cm['name']} by {cm.get('author', 'Unknown')}\n" result += f" Description: {cm.get('description', 'No description')}\n" result += f" Category: {cm.get('category', 'Unknown')}\n" if cm.get("tags"): result += f" Tags: {', '.join(cm['tags'])}\n" result += f" Install as: {cm.get('install_name', cm['name'] + '.chatmode.md')}\n" result += "\n" else: result += "No chatmodes found matching your criteria.\n\n" instructions = library_data["instructions"] if instructions: result += f"INSTRUCTIONS ({len(instructions)} available):\n\n" for inst in instructions: result += f"{inst['name']} by {inst.get('author', 'Unknown')}\n" result += f" Description: {inst.get('description', 'No description')}\n" result += f" Category: {inst.get('category', 'Unknown')}\n" if inst.get("tags"): result += f" Tags: {', '.join(inst['tags'])}\n" result += f" Install as: {inst.get('install_name', inst['name'] + INSTRUCTION_FILE_EXTENSION)}\n" result += "\n" else: result += "No instructions found matching your criteria.\n\n" categories = library_data.get("categories", []) if categories: result += "AVAILABLE CATEGORIES:\n" for cat in categories: result += f" • {cat['name']} ({cat['id']}) - {cat.get('description', 'No description')}\n" result += "\n" result += "Usage: Use install_from_library('Name') to install any item.\n" return result except FileOperationError as e: return f"Error browsing library: {str(e)}" except Exception as e: return f"Unexpected error browsing library: {str(e)}"
- src/mode_manager_mcp/tools/library_tools.py:48-63 (registration)The @app.tool decorator that registers the 'browse_mode_library' tool with the MCP server, including metadata, description, tags, and schema annotations for inputs and outputs.@app.tool( name="browse_mode_library", description="Browse the Mode Manager MCP Library and filter by category or search term.", tags={"public", "library"}, annotations={ "idempotentHint": True, "readOnlyHint": True, "title": "Browse Mode Library", "parameters": { "category": "Optional category filter to show only items from a specific category. Use list without filter to see available categories.", "search": "Optional search term to filter items by name, description, or tags.", }, "returns": "Returns a formatted list of available chatmodes and instructions from the library, with details like name, author, description, category, and installation name. Also shows available categories and usage instructions.", }, meta={"category": "library"}, )
- Schema definitions for the tool's parameters (category and search as optional strings) and returns description in the annotations.annotations={ "idempotentHint": True, "readOnlyHint": True, "title": "Browse Mode Library", "parameters": { "category": "Optional category filter to show only items from a specific category. Use list without filter to see available categories.", "search": "Optional search term to filter items by name, description, or tags.", }, "returns": "Returns a formatted list of available chatmodes and instructions from the library, with details like name, author, description, category, and installation name. Also shows available categories and usage instructions.", },
- src/mode_manager_mcp/tools/__init__.py:18-25 (registration)The register_all_tools function which calls register_library_tools(), thereby triggering the registration of the browse_mode_library tool.def register_all_tools() -> None: """Register all tools with the server.""" register_instruction_tools() register_chatmode_tools() register_library_tools() register_memory_tools() register_remember_tools()