health_check
Verify connectivity to GitLab servers by checking connection status and API availability for self-hosted instances.
Instructions
健康檢查,確認與 GitLab 伺服器的連線狀態
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/gitlab_mcp/server.py:48-60 (handler)The health_check tool implementation which uses a GitLab client to test connection and report status.
@mcp.tool() def health_check() -> str: """健康檢查,確認與 GitLab 伺服器的連線狀態""" try: client = get_client() config = get_config() if client.test_connection(): version_info = client.get_server_version() return f"✓ 連線正常 — {config.gitlab_url}(GitLab {version_info.get('version', '?')})" else: return f"✗ 無法連接到 {config.gitlab_url}" except Exception as e: return f"✗ 連線異常: {str(e)}"