get_trackers
Retrieve all available trackers from Redmine to categorize and manage project issues effectively.
Instructions
取得所有可用的追蹤器列表
Returns:
格式化的追蹤器列表
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/redmine_mcp/server.py:290-319 (handler)The main MCP tool handler for 'get_trackers'. Decorated with @mcp.tool() for automatic registration. Fetches trackers from RedmineClient and formats output as a table.@mcp.tool() def get_trackers() -> str: """ 取得所有可用的追蹤器列表 Returns: 格式化的追蹤器列表 """ try: client = get_client() trackers = client.get_trackers() if not trackers: return "沒有找到追蹤器" result = "可用的追蹤器:\n\n" result += f"{'ID':<5} {'名稱':<20} {'預設狀態':<12}\n" result += f"{'-'*5} {'-'*20} {'-'*12}\n" for tracker in trackers: default_status = tracker.get('default_status', {}).get('name', 'N/A') result += f"{tracker['id']:<5} {tracker['name']:<20} {default_status:<12}\n" return result except RedmineAPIError as e: return f"取得追蹤器列表失敗: {str(e)}" except Exception as e: return f"系統錯誤: {str(e)}"
- RedmineClient helper method that performs the API call to retrieve the list of trackers from Redmine's /trackers.json endpoint.def get_trackers(self) -> List[Dict[str, Any]]: """取得追蹤器列表""" response = self._make_request('GET', '/trackers.json') return response.get('trackers', [])
- src/redmine_mcp/server.py:19-19 (registration)The FastMCP server instance creation where all @mcp.tool() decorated functions are automatically registered as MCP tools.mcp = FastMCP("Redmine MCP")