todoist_project_get
Retrieve all Todoist projects with their IDs and names to manage tasks and organize workflows effectively.
Instructions
Get a list of all projects from Todoist with their IDs and names
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers/project-handlers.ts:12-27 (handler)The handler function that executes the tool: fetches all Todoist projects using the API and returns a formatted list of project names and IDs.export async function handleGetProjects( todoistClient: TodoistApi ): Promise<string> { const result = await todoistClient.getProjects(); // Handle the new API response format with 'results' property const projects = extractArrayFromResponse<TodoistProject>(result); const projectList = projects .map((project: TodoistProject) => `- ${project.name} (ID: ${project.id})`) .join("\n"); return projects.length > 0 ? `Projects:\n${projectList}` : "No projects found"; }
- src/tools/project-tools.ts:4-12 (schema)Tool schema definition: specifies the name, description, and empty input schema (no parameters required).export const GET_PROJECTS_TOOL: Tool = { name: "todoist_project_get", description: "Get a list of all projects from Todoist with their IDs and names", inputSchema: { type: "object", properties: {}, }, };
- src/index.ts:184-189 (registration)Tool registration in the main server request handler: switch case that validates arguments and calls the project handler.case "todoist_project_get": if (!isGetProjectsArgs(args)) { throw new Error("Invalid arguments for todoist_project_get"); } result = await handleGetProjects(apiClient); break;