check_documentation_health
Test connectivity and status of Ilograph's documentation fetching service, including cache statistics and health reports.
Instructions
Checks the health and connectivity of the documentation fetching service.
This tool performs connectivity tests and returns status information about
the documentation fetching capabilities, including cache statistics.
Returns:
str: Health status report with service connectivity and cache information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The handler function for the 'check_documentation_health' tool. It uses @mcp.tool decorator for registration and implements the logic to check the health of the documentation service, including service connectivity and cache status, returning a formatted Markdown report.annotations={ "title": "Check Documentation Service Health", "readOnlyHint": True, "description": "Checks the health and connectivity of the documentation fetching service", } ) async def check_documentation_health(ctx: Context) -> str: """ Checks the health and connectivity of the documentation fetching service. This tool performs connectivity tests and returns status information about the documentation fetching capabilities, including cache statistics. Returns: str: Health status report with service connectivity and cache information """ try: await ctx.info("Performing documentation service health check") fetcher = get_fetcher() health_info = await fetcher.health_check() # Format health report health_md = "# Documentation Service Health Report\n\n" health_md += f"**Overall Status:** {health_info['status'].upper()}\n\n" # Service status health_md += "## Service Connectivity\n\n" for service, info in health_info["services"].items(): status_emoji = "✅" if info["status"] == "healthy" else "❌" health_md += f"{status_emoji} **{service.title()}**: {info['status'].upper()}\n" health_md += f" - URL: {info['url']}\n" if "error" in info: health_md += f" - Error: {info['error']}\n" health_md += "\n" # Cache statistics cache_stats = health_info["cache_stats"] health_md += "## Cache Statistics\n\n" health_md += f"- **Total Entries:** {cache_stats['total_entries']}\n" health_md += f"- **Valid Entries:** {cache_stats['valid_entries']}\n" health_md += f"- **Expired Entries:** {cache_stats['expired_entries']}\n" if cache_stats["keys"]: health_md += f"- **Cached Keys:** {', '.join(cache_stats['keys'])}\n" health_md += "\n---\n\n" if health_info["status"] == "healthy": health_md += "*All services are operational and ready to fetch documentation.*" elif health_info["status"] == "degraded": unhealthy = health_info.get("unhealthy_services", []) health_md += f"*Some services are experiencing issues: {', '.join(unhealthy)}. Documentation fetching may be limited.*" await ctx.info(f"Health check completed - Status: {health_info['status']}") return health_md except Exception as e: error_msg = f"Error performing health check: {str(e)}" await ctx.error(error_msg) return f"Error: {error_msg}"
- src/ilograph_mcp/server.py:61-61 (registration)Top-level registration call in the server setup that invokes the function to register the documentation tools, including 'check_documentation_health'.register_fetch_documentation_tool(mcp)
- src/ilograph_mcp/tools/__init__.py:9-9 (registration)Re-export of the register function in the tools package init for easier imports.from .register_fetch_documentation_tools import get_tool_info, register_fetch_documentation_tool
- Helper function that provides metadata about the documentation tools, listing 'check_documentation_health' among them.def get_tool_info() -> dict: """Get information about the documentation tools for registration.""" return { "name": "fetch_documentation_tool", "description": "Fetches comprehensive Ilograph documentation with markdown formatting", "tools": [ "fetch_documentation_tool", "list_documentation_sections", "check_documentation_health", ], }