get_projects
Retrieve all projects from TickTick task management to organize and access your work lists.
Instructions
Get all projects from TickTick
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:259-268 (handler)Handler for the 'get_projects' tool in the MCP server request handler. It calls the TickTickClient's getProjects method and returns the projects as a JSON string in the response content.case 'get_projects': const projects = await this.ticktickClient!.getProjects(); return { content: [ { type: 'text', text: JSON.stringify(projects, null, 2), }, ], };
- src/types.ts:47-73 (schema)Zod schema definition for TickTickProject, used as the type for projects returned by getProjects.export const TickTickProjectSchema = z.object({ id: z.string(), name: z.string(), color: z.string().optional(), inAll: z.boolean().optional(), sortOrder: z.number().optional(), sortType: z.string().optional(), userCount: z.number().optional(), etag: z.string().optional(), modifiedTime: z.string().optional(), closed: z.boolean().optional(), muted: z.boolean().optional(), transferred: z.boolean().optional(), groupId: z.string().optional(), viewMode: z.string().optional(), notificationOptions: z.object({ beMentioned: z.boolean().optional(), newTaskAssignedToMe: z.boolean().optional(), newTaskCreated: z.boolean().optional(), taskCompleted: z.boolean().optional(), taskDeleted: z.boolean().optional(), taskUpdated: z.boolean().optional() }).optional(), teamId: z.string().optional(), permission: z.string().optional(), kind: z.string().optional() });
- src/index.ts:82-89 (registration)Registration of the 'get_projects' tool in the MCP tools list, including name, description, and empty input schema.{ name: 'get_projects', description: 'Get all projects from TickTick', inputSchema: { type: 'object', properties: {}, }, },
- src/ticktick-client.ts:288-297 (helper)Core implementation of getProjects in TickTickClient class, which authenticates and makes an API GET request to '/project' to fetch the list of projects.async getProjects(): Promise<TickTickProject[]> { await this.ensureAuthenticated(); try { const response = await this.client.get('/project'); return response.data || []; } catch (error) { throw new Error(`Failed to get projects: ${error instanceof Error ? error.message : 'Unknown error'}`); } }