health_check
Verify the operational status of the CSV Editor server to ensure it's ready for data processing tasks.
Instructions
Check the health status of the CSV Editor.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/csv_editor/server.py:28-54 (handler)The main handler function for the 'health_check' tool. It is decorated with @mcp.tool, which registers it with the FastMCP server. The function performs a health check by retrieving session manager stats and returns a status dictionary.
@mcp.tool async def health_check(ctx: Context) -> Dict[str, Any]: """Check the health status of the CSV Editor.""" session_manager = get_session_manager() try: active_sessions = len(session_manager.sessions) if ctx: await ctx.info("Health check performed successfully") return { "success": True, "status": "healthy", "version": "1.0.0", "active_sessions": active_sessions, "max_sessions": session_manager.max_sessions, "session_ttl_minutes": session_manager.ttl_minutes, } except Exception as e: if ctx: await ctx.error(f"Health check failed: {str(e)}") return { "success": False, "status": "error", "error": str(e) }