get_projects
Retrieve all project lists from Dida365, including names, IDs, and color information for task management.
Instructions
获取所有项目(清单)列表。返回所有项目的名称、ID、颜色等信息。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/dida_mcp/client.py:52-56 (handler)The core API client method that fetches the list of projects from the Dida365 API.
def get_projects(self) -> List[Dict]: """获取所有项目(清单)列表""" response = self.client.get("/project") response.raise_for_status() return response.json() - src/dida_mcp/server.py:89-97 (registration)MCP tool definition for 'get_projects' in the server configuration.
{ "name": "get_projects", "description": "获取所有项目(清单)列表。返回所有项目的名称、ID、颜色等信息。", "inputSchema": { "type": "object", "properties": {}, "required": [], }, }, - src/dida_mcp/server.py:295-303 (handler)The tool handler dispatch logic in the server that calls the client method and formats the output.
if name == "get_projects": projects = client.get_projects() if not projects: return "📭 没有找到任何项目。" lines = ["📋 共 %d 个项目:\n" % len(projects)] for p in projects: lines.append(format_project(p)) lines.append("") return "\n".join(lines)