get_guideline_content
Fetch specific GO-CAM guideline content for biological knowledge modeling. Use to retrieve annotation guidelines for gene ontology causal activity models.
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 |
Input Schema (JSON Schema)
{
"properties": {
"guideline_name": {
"type": "string"
}
},
"required": [
"guideline_name"
],
"type": "object"
}
Implementation Reference
- src/noctua_mcp/mcp_server.py:1904-1958 (handler)The handler function for the 'get_guideline_content' MCP tool. It reads the specified guideline Markdown file from the GUIDELINES_DIR, extracts a description from the first non-empty line, and returns the content along with metadata. If the file doesn't exist, it lists available guidelines using the helper function.@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 }
- Helper function that lists all available guideline files (stems of .md files) in the GUIDELINES_DIR. Used by get_guideline_content in error cases to provide available options.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")])
- src/noctua_mcp/mcp_server.py:28-28 (helper)Definition of GUIDELINES_DIR constant, pointing to the local 'guidelines' directory containing the Markdown guideline files used by the tool.GUIDELINES_DIR = Path(__file__).parent / "guidelines"
- src/noctua_mcp/mcp_server.py:1904-1904 (registration)MCP tool registration decorator that registers the get_guideline_content function as an MCP tool.@mcp.tool()
- Supporting tool 'list_guidelines' that lists available guidelines using the same helper, explicitly instructing to use get_guideline_content.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" }