Skip to content

Commit fe4a91f

Browse files
fix: Allow inbox as a project id (#193)
1 parent ac21949 commit fe4a91f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/tools/find-tasks.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ const { FIND_COMPLETED_TASKS, ADD_TASKS } = ToolNames
2424

2525
const ArgsSchema = {
2626
searchText: z.string().optional().describe('The text to search for in tasks.'),
27-
projectId: z.string().optional().describe('Find tasks in this project.'),
27+
projectId: z
28+
.string()
29+
.optional()
30+
.describe(
31+
'Find tasks in this project. Project ID should be an ID string, or the text "inbox", for inbox tasks.',
32+
),
2833
sectionId: z.string().optional().describe('Find tasks in this section.'),
2934
parentId: z.string().optional().describe('Find subtasks of this parent task.'),
3035
responsibleUser: z
@@ -101,7 +106,10 @@ const findTasks = {
101106
cursor: cursor ?? null,
102107
}
103108

104-
if (projectId) taskParams.projectId = projectId
109+
if (projectId) {
110+
taskParams.projectId =
111+
projectId === 'inbox' ? todoistUser.inboxProjectId : projectId
112+
}
105113
if (sectionId) taskParams.sectionId = sectionId
106114
if (parentId) taskParams.parentId = parentId
107115

0 commit comments

Comments
 (0)