list_guidelines
List all available GO-CAM guideline documents to identify which guidelines can be accessed for detailed content.
Instructions
List all available GO-CAM guideline documents.
Returns a list of available guideline names that can be accessed using the get_guideline_content tool.
Returns: Dictionary with 'guidelines' key containing list of available guidelines
Examples: # List all available guidelines result = list_guidelines() for guide in result['guidelines']: print(guide)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/noctua_mcp/mcp_server.py:1879-1901 (handler)The main tool handler for 'list_guidelines' - an MCP tool decorated with @mcp.tool() that lists all available GO-CAM guideline documents. It calls _get_available_guidelines() helper and returns a dictionary with guidelines list, count, and a note about using get_guideline_content.
@mcp.tool() async def list_guidelines() -> Dict[str, Any]: """List all available GO-CAM guideline documents. Returns a list of available guideline names that can be accessed using the get_guideline_content tool. Returns: Dictionary with 'guidelines' key containing list of available guidelines Examples: # List all available guidelines result = list_guidelines() for guide in result['guidelines']: print(guide) """ guidelines = _get_available_guidelines() return { "guidelines": guidelines, "count": len(guidelines), "note": "Use get_guideline_content(guideline_name) to fetch any guideline" } - src/noctua_mcp/mcp_server.py:1879-1879 (registration)Registration of the 'list_guidelines' tool via the @mcp.tool() decorator on the async function. This registers the function as an MCP tool with the FastMCP server.
@mcp.tool() - Helper function _get_available_guidelines() used by list_guidelines to scan the GUIDELINES_DIR for .md files and return sorted list of available guideline names (file stems).
def _get_available_guidelines() -> List[str]: """Get list of available guideline files.""" if not GUIDELINES_DIR.exists(): return [] return sorted([f.stem for f in GUIDELINES_DIR.glob("*.md")]) - Helper function _inject_guideline_list() used by resource handlers to append a formatted list of available guidelines to content.
def _inject_guideline_list(content: str, title: str) -> str: """Inject list of available guidelines at the end of content.""" guidelines = _get_available_guidelines() if not guidelines: return content # Create formatted list guideline_section = "\n\n## Available GO-CAM Guidelines\n\n" guideline_section += f"This is the '{title}' guideline. Other available guidelines include:\n\n" for guide in guidelines: # Skip the current one if guide == title: continue # Make the filename more readable readable_name = guide.replace("_", " ").replace("-", " ") guideline_section += f"- {readable_name}\n" guideline_section += "\nUse the `get_guideline_content` tool to access any specific guideline." return content + guideline_section - Companion tool get_guideline_content() that pairs with list_guidelines to fetch specific guideline content by name.
@mcp.tool() async def get_guideline_content(guideline_name: str) -> Dict[str, Any]: """Fetch specific GO-CAM guideline content. Args: guideline_name: Name of guideline file (without .md extension). Use list_guidelines() to see available options. Returns: Dictionary with guideline content or error message Examples: # Get a specific guideline content = get_guideline_content("E3_ubiquitin_ligases") # Get transcription factor guidelines content = get_guideline_content("DNA-binding_transcription_factor_activity_annotation_guidelines") """ file_path = GUIDELINES_DIR / f"{guideline_name}.md" if not file_path.exists(): available = _get_available_guidelines() return { "success": False, "error": f"Guideline '{guideline_name}' not found", "available_guidelines": available, "hint": "Use one of the available guideline names listed above" } try: with open(file_path) as f: content = f.read() # Extract first heading as description lines = content.split('\n') description = "" for line in lines: if line.strip(): description = line.strip('#').strip() break return { "success": True, "guideline_name": guideline_name, "description": description, "content": content, "length": len(content) } except Exception as e: return { "success": False, "error": f"Failed to read guideline: {str(e)}", "guideline_name": guideline_name }