ocr_health_check
Check the operational status of the OCR MCP Service to verify its readiness for processing image text extraction requests.
Instructions
Return lightweight health status for the stdio runtime.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/local_ocr_mcp/server.py:45-48 (handler)The tool registration and entry point for 'ocr_health_check'. It calls the health_service.build_response() method.
@mcp.tool() def ocr_health_check() -> dict[str, Any]: """Return lightweight health status for the stdio runtime.""" return health_service.build_response() - The implementation of the logic for the health check. It constructs a dictionary response containing health and uptime information.
def build_response(self) -> dict[str, Any]: """Return the standardized health-check envelope.""" health = ServiceHealth( status="healthy", uptime_ms=int((time.monotonic() - self._service_start_monotonic) * 1000), transport="stdio", runtime_version=__version__, ) response = ToolResponse( status="ok", data=health.to_dict(), error=None, meta=ResponseMeta( timestamp=datetime.now(timezone.utc).isoformat(), runtime_version=__version__, ), ) return response.to_dict()