Troubleshooting: `get_inbox_tasks` Fails with "Not Found" Error
You might encounter an issue where calling the get_inbox_tasks function in the @alexarevalo9/ticktick-mcp-server package results in a "Not Found: Resource not found: Resource" error. This can be frustrating, especially when other functions like get_user_projects and get_project_with_data are working as expected.
Understanding the Problem
The get_inbox_tasks function is designed to retrieve tasks specifically from your TickTick Inbox. The "Not Found" error indicates that the server is unable to locate the resource associated with the Inbox. This often means the server is failing to correctly identify the Inbox's project ID.
Possible Root Cause
Based on the error and successful workaround, the most likely cause is that the get_inbox_tasks function attempts to dynamically resolve the Inbox project ID. This resolution might involve querying a user profile endpoint expecting a specific field (e.g., inboxId). If this field is missing, incorrectly formatted, or the endpoint is unavailable, the function will fail to retrieve the correct project ID, leading to the "Not Found" error. It's possible that this issue only affects a subset of user accounts due to variations in user profile data.
Solution: Using get_project_with_data as a Workaround
A reliable workaround is to use the get_project_with_data function with the projectId set to "inbox". This approach directly specifies the Inbox project ID, bypassing the potentially problematic dynamic resolution logic in get_inbox_tasks.
Here's how you can use it:
const inboxTasks = await get_project_with_data({ projectId: "inbox" });
// inboxTasks will now contain the tasks from your TickTick Inbox
console.log(inboxTasks);
This code snippet demonstrates how to call get_project_with_data with the projectId set to "inbox". The returned inboxTasks variable will contain the data for your inbox, including the list of tasks.
Alternative Solution: Patching get_inbox_tasks (Advanced)
If you have access to modify the @alexarevalo9/ticktick-mcp-server package code locally, you can patch the get_inbox_tasks function to directly use "inbox" as the project ID. This ensures consistent behavior regardless of the user profile data.
Here's an example of how you might modify the function (this is a conceptual example and might need adjustments based on the actual code):
// Original (simplified) get_inbox_tasks function:
async function get_inbox_tasks() {
// Potentially problematic logic to get inboxId from user profile
// const inboxId = await getUserProfileInboxId();
// return get_project_with_data({ projectId: inboxId });
}
// Modified get_inbox_tasks function:
async function get_inbox_tasks() {
return get_project_with_data({ projectId: "inbox" });
}
Warning: Modifying package code directly can lead to compatibility issues when updating the package. Consider creating a pull request with your fix to the original repository so everyone can benefit!
Important Considerations
- API Stability: While
"inbox"appears to be a stable project ID for the TickTick Inbox, it's always possible that the TickTick API could change in the future. Keep an eye on updates to the@alexarevalo9/ticktick-mcp-serverpackage. - Error Handling: Even with the workaround, implement robust error handling to gracefully manage potential API issues or unexpected responses.
- Community Reporting: If you encounter this issue, consider reporting it on the
@alexarevalo9/ticktick-mcp-serverproject's issue tracker on GitHub. This helps maintainers understand the scope of the problem and prioritize a proper fix.