server_info
Retrieve GitLab MCP server information and connection status to verify API accessibility and server health for managing GitLab instances.
Instructions
取得 GitLab MCP 服務器資訊和連線狀態
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": "server_info"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/gitlab_mcp/server.py:29-45 (handler)The `server_info` tool implementation, which retrieves GitLab server information and connection status. It is registered using the `@mcp.tool()` decorator.
@mcp.tool() def server_info() -> str: """取得 GitLab MCP 服務器資訊和連線狀態""" config = get_config() try: client = get_client() version_info = client.get_server_version() gitlab_version = version_info.get("version", "未知") return f"""GitLab MCP 服務器已啟動 - GitLab 位址: {config.gitlab_url} - GitLab 版本: {gitlab_version} - API 逾時: {config.timeout}秒 - 日誌級別: {config.log_level}""" except GitLabAPIError as e: return f"""GitLab MCP 服務器已啟動(無法取得版本資訊) - GitLab 位址: {config.gitlab_url} - 連線錯誤: {str(e)}"""