get_project_by_projectId
Retrieve detailed project information including name, color, view mode, kind, and sort order by providing the project ID from TickTick/Dida365 task management systems.
Instructions
Get detailed information about a specific project by its ID. Returns project metadata including name, color, view mode, kind and sort order.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | The ID of the project to retrieve (required) |
Implementation Reference
- src/index.ts:529-541 (handler)Inline handler for the 'get_project_by_projectId' tool. Extracts projectId from args, validates it using throwValidError, calls dida365Api.get(`/project/${projectId}`), and returns the response as formatted text content.case "get_project_by_projectId":{ const projectId = args.projectId as string; throwValidError(projectId,"1"); const response: AxiosResponse = await dida365Api.get(`project/${projectId}`); return { content:[ { type:"text", text: `获取project成功: ${JSON.stringify(response.data, null, 2)}` } ] } }
- src/index.ts:250-262 (schema)Tool schema definition including name, description, and inputSchema with required 'projectId' string parameter. This is part of the tools list returned by ListToolsRequestHandler.name: "get_project_by_projectId", description: "Get detailed information about a specific project by its ID. Returns project metadata including name, color, view mode, kind and sort order.", inputSchema: { type: "object", properties: { projectId: { type: "string", description: "The ID of the project to retrieve (required)" } }, required: ["projectId"] } },
- src/index.ts:638-642 (helper)Helper function used for input validation in the handler. Called with projectId and dummy taskId "1" to validate that projectId is provided.function throwValidError(projectId : string,taskId : string){ if(!projectId&&!taskId) throw new McpError(ErrorCode.InvalidRequest,"projectId 和 taskId 为空") if(!projectId) throw new McpError(ErrorCode.InvalidRequest,"projectId 为空") if(!taskId) throw new McpError(ErrorCode.InvalidRequest,"taskId 为空") }