> ## Documentation Index
> Fetch the complete documentation index at: https://finance.chiefpriest.design/llms.txt
> Use this file to discover all available pages before exploring further.

# Health Check

> Check the health and status of the Financial MCP Server

Verify that the Financial MCP Server is running properly and check the status of all integrated services.

## Response

<ResponseField name="status" type="string">
  Overall health status: "healthy", "degraded", or "unhealthy"
</ResponseField>

<ResponseField name="timestamp" type="string">
  Current server timestamp
</ResponseField>

<ResponseField name="version" type="string">
  Server version information
</ResponseField>

<ResponseField name="uptime" type="number">
  Server uptime in seconds
</ResponseField>

<ResponseField name="services" type="object">
  Status of individual services

  <Expandable title="services properties">
    <ResponseField name="yfinance" type="object">
      YFinance service status

      <Expandable title="yfinance properties">
        <ResponseField name="status" type="string">
          Service status (operational, degraded, down)
        </ResponseField>

        <ResponseField name="last_check" type="string">
          Last health check timestamp
        </ResponseField>

        <ResponseField name="response_time" type="number">
          Average response time in milliseconds
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="fmp" type="object">
      Financial Modeling Prep service status

      <Expandable title="fmp properties">
        <ResponseField name="status" type="string">
          Service status (operational, degraded, down)
        </ResponseField>

        <ResponseField name="last_check" type="string">
          Last health check timestamp
        </ResponseField>

        <ResponseField name="response_time" type="number">
          Average response time in milliseconds
        </ResponseField>

        <ResponseField name="api_key_valid" type="boolean">
          Whether the API key is valid
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="tools" type="object">
  Summary of available tools

  <Expandable title="tools properties">
    <ResponseField name="total" type="number">
      Total number of available tools
    </ResponseField>

    <ResponseField name="yfinance_tools" type="number">
      Number of YFinance tools
    </ResponseField>

    <ResponseField name="fmp_tools" type="number">
      Number of FMP tools
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="environment" type="object">
  Environment information

  <Expandable title="environment properties">
    <ResponseField name="python_version" type="string">
      Python version
    </ResponseField>

    <ResponseField name="platform" type="string">
      Operating system platform
    </ResponseField>

    <ResponseField name="memory_usage" type="object">
      Memory usage statistics
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://stocks-dev.up.railway.app/api/v1/health"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('/api/v1/health');
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get('https://stocks-dev.up.railway.app/api/v1/health')
  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "status": "healthy",
    "timestamp": "2024-01-19T15:30:00Z",
    "version": "1.0.0",
    "uptime": 86400,
    "services": {
      "yfinance": {
        "status": "operational",
        "last_check": "2024-01-19T15:29:45Z",
        "response_time": 245
      },
      "fmp": {
        "status": "operational",
        "last_check": "2024-01-19T15:29:50Z",
        "response_time": 156,
        "api_key_valid": true
      }
    },
    "tools": {
      "total": 32,
      "yfinance_tools": 6,
      "fmp_tools": 26
    },
    "environment": {
      "python_version": "3.11.7",
      "platform": "linux",
      "memory_usage": {
        "used": "245MB",
        "available": "1.2GB"
      }
    }
  }
  ```
</ResponseExample>

## Status Codes

### Overall Status

* **healthy**: All services operational
* **degraded**: Some services experiencing issues
* **unhealthy**: Critical services down

### Service Status

* **operational**: Service working normally
* **degraded**: Service slow or intermittent issues
* **down**: Service unavailable

## Use Cases

* **Monitoring**: Automated health checks
* **Troubleshooting**: Diagnose service issues
* **Load Balancing**: Route traffic to healthy instances
* **Alerting**: Set up monitoring alerts
* **Maintenance**: Check status before deployments

## Monitoring Best Practices

1. **Regular Checks**: Poll every 30-60 seconds
2. **Alert Thresholds**: Alert on "degraded" or "unhealthy"
3. **Response Time**: Monitor service response times
4. **Uptime Tracking**: Track availability metrics
5. **Dependency Monitoring**: Watch external service status

## Notes

* No authentication required for health checks
* Endpoint designed for high-frequency monitoring
* Includes both internal and external service dependencies
* Response times are rolling averages over the last 5 minutes
* Memory usage updated every minute
