Skip to content

Health Check CLI Documentation

The Health Check CLI module provides commands for checking the health of API endpoints and system resources used by BioMCP.

Tip: Use the --help flag with any command (e.g., biomcp health check --help) to see the most up-to-date options directly from the tool.

Check Command (check)

Run a comprehensive health check on API endpoints and system resources.

Usage

biomcp health check [OPTIONS]

Options

  • --api-only: Check only API endpoints. [default: False]
  • --system-only: Check only system health. [default: False]
  • -v, --verbose: Show detailed error information and API responses. [default: False]
  • --help: Show help message and exit.

API Endpoints Checked

The health check command tests connectivity and responses from all external APIs that BioMCP depends on:

  1. PubTator3 API:

  2. Autocomplete endpoint

  3. Publications export endpoint
  4. Search endpoint

  5. ClinicalTrials.gov API:

  6. Studies search endpoint

  7. Individual study retrieval endpoint

  8. MyVariant.info API:

  9. Query endpoint
  10. Variant retrieval endpoint

System Health Checks

When checking system health, the command evaluates:

  • Network connectivity: Tests basic internet connectivity
  • System resources: Monitors CPU usage, memory availability, and disk space
  • Python environment: Reports Python version and critical dependencies

Note: For full system resource checks, the psutil package is required. If not installed, the command will still run but will indicate that psutil is missing.

Examples

Run a complete health check (API endpoints and system resources):

biomcp health check

Check only API endpoints:

biomcp health check --api-only

Check only system resources:

biomcp health check --system-only

Show detailed error information for any failing checks:

biomcp health check --verbose

Combine options as needed:

biomcp health check --api-only --verbose

Output

The command displays results in formatted tables:

  1. API Endpoints Health: Shows the status of each API endpoint (200 OK or error code)
  2. System Resources: Displays CPU, memory, and disk usage statistics
  3. Network & Environment: Shows network connectivity status and Python environment details

In verbose mode, detailed error information is displayed for any failing endpoints, which can help diagnose API-related issues.

Exit Status

The command provides a summary of overall health status:

  • "✓ All systems operational!" when all checks pass
  • "⚠ Some health checks failed." when one or more checks fail