health_check
Verify connectivity to GitLab servers by checking connection status and API availability for self-hosted instances.
Instructions
健康檢查,確認與 GitLab 伺服器的連線狀態
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "health_check"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
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)}"