get_projects
Fetch a formatted list of accessible projects from Redmine using the Model Context Protocol server to streamline project management and search operations.
Instructions
取得可存取的專案列表
Returns:
格式化的專案列表
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"title": "get_projectsArguments",
"type": "object"
}
Implementation Reference
- src/redmine_mcp/server.py:414-443 (handler)The get_projects tool handler: decorated with @mcp.tool(), fetches accessible Redmine projects using the client, formats them into a table, and returns the string result.@mcp.tool() def get_projects() -> str: """ 取得可存取的專案列表 Returns: 格式化的專案列表 """ try: client = get_client() projects = client.list_projects(limit=50) if not projects: return "沒有找到可存取的專案" result = f"找到 {len(projects)} 個專案:\n\n" result += f"{'ID':<5} {'識別碼':<20} {'名稱':<30} {'狀態':<8}\n" result += f"{'-'*5} {'-'*20} {'-'*30} {'-'*8}\n" for project in projects: status_text = "正常" if project.status == 1 else "封存" name = project.name[:27] + "..." if len(project.name) > 30 else project.name result += f"{project.id:<5} {project.identifier:<20} {name:<30} {status_text:<8}\n" return result except RedmineAPIError as e: return f"取得專案列表失敗: {str(e)}" except Exception as e: return f"系統錯誤: {str(e)}"