get_guideline_content
Fetch a specific GO-CAM guideline by its name, providing detailed annotation rules and examples.
Instructions
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")Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| guideline_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/noctua_mcp/mcp_server.py:1904-1957 (handler)The 'get_guideline_content' tool handler function. Registered with @mcp.tool() decorator. Accepts a guideline_name parameter (filename without .md extension), reads the .md file from the GUIDELINES_DIR directory, and returns its content along with metadata like description and length. Returns an error if the file doesn't exist, listing available alternatives.
@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 } - src/noctua_mcp/mcp_server.py:1904-1905 (registration)Registration of 'get_guideline_content' as an MCP tool via the @mcp.tool() decorator on line 1904.
@mcp.tool() async def get_guideline_content(guideline_name: str) -> Dict[str, Any]: - Helper function _get_available_guidelines() that lists available guideline files in the GUIDELINES_DIR directory. Used by both list_guidelines() tool and get_guideline_content tool.
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() which appends a list of available guidelines to markdown content and references the get_guideline_content tool.
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 - src/noctua_mcp/mcp_server.py:28-28 (helper)Definition of GUIDELINES_DIR at module level (Path(__file__).parent / 'guidelines'), used by get_guideline_content and related guideline tools.
GUIDELINES_DIR = Path(__file__).parent / "guidelines"