Skip to content

feat: Goal MCP tools#433

Open
domjost wants to merge 9 commits intomainfrom
goals/pr-4-mcp
Open

feat: Goal MCP tools#433
domjost wants to merge 9 commits intomainfrom
goals/pr-4-mcp

Conversation

@domjost
Copy link
Copy Markdown

@domjost domjost commented Apr 2, 2026

Summary

  • Add 5 new tools: find-goals, add-goals, update-goals, complete-goals, link-goal-tasks
  • Add GoalSchema to output schemas
  • Add goal to delete-object and fetch-object entity types
  • Register all goal tools in MCP server

Part of bringing the Goals feature to the REST API, CLI, and MCP. See spec.

Depends on SDK PR (Doist/todoist-sdk-typescript#548). Can be merged in parallel with CLI PR (Doist/todoist-cli#218).

PR Repo URL Base
1.1 Pagination Todoist #27272 main
1.2 CRUD + lifecycle Todoist #27273 PR 1.1
1.3 Search Todoist #27274 PR 1.2
1.4 Item linking Todoist #27275 PR 1.3
1.5 goal_id on tasks Todoist #27276 PR 1.4
2 SDK types + methods todoist-sdk-typescript #548 main
3 CLI td goal todoist-cli #218 main
4 MCP tools todoist-ai #433 main

Merge order: 1.1 → 1.2 → 1.3 → 1.4 → 1.5 → 2 → (3 + 4 in parallel)

Test plan

  • npx tsc --noEmit passes
  • Manual testing with MCP client after SDK is published

🤖 Generated with Claude Code

@doistbot doistbot requested a review from gnapse April 2, 2026 18:10
@domjost domjost requested review from scottlovegrove and removed request for gnapse April 2, 2026 18:15
Copy link
Copy Markdown
Member

@doistbot doistbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR introduces five new MCP tools for managing goals, along with the corresponding schema updates and expanded entity types. Expanding these capabilities is a fantastic addition that will significantly enhance the server's utility. There are a few implementation details to address, specifically completing the tool registration across all required index, script, and test files, updating the schema and runtime logic to use provider-safe sentinel strings instead of null values for clearing fields, and bumping the @doist/todoist-sdk dependency to ensure the new APIs resolve correctly.

Share FeedbackReview Logs

Copy link
Copy Markdown
Collaborator

@scottlovegrove scottlovegrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're missing an update to

'Search for a goal by name (partial and case insensitive match). Supports wildcards (e.g. "ship*"). If omitted, all goals are returned.',
),
ownerType: z
.enum(['USER', 'WORKSPACE'])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to import this array from the Todoist SDK when it's published, rather than having it as its own thing.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — added a TODO for now. We exported GOAL_OWNER_TYPES from the SDK in PR #548, so once that's published we can import it directly instead of the hardcoded array.

@domjost
Copy link
Copy Markdown
Author

domjost commented Apr 3, 2026

We're missing an update to

@scottlovegrove to... ? 😅

@scottlovegrove
Copy link
Copy Markdown
Collaborator

to... ? 😅

I wrote that in the review field to remind myself to mention something, then realised I didn't need and then completely forgot to remove it from the review 🤦🏻‍♂️

@domjost
Copy link
Copy Markdown
Author

domjost commented Apr 3, 2026

@gnapse renamed link-goal-itemslink-goal-tasks, itemIdstaskIds, and SDK methods linkItemToGoal/unlinkItemFromGoallinkTaskToGoal/unlinkTaskFromGoal across all three repos (SDK, CLI, MCP).

Copy link
Copy Markdown
Collaborator

@gnapse gnapse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of improvement suggestions.

@domjost
Copy link
Copy Markdown
Author

domjost commented Apr 8, 2026

@scottlovegrove @gnapse any objections before I merge?

@scottlovegrove
Copy link
Copy Markdown
Collaborator

any objections before I merge?

No objections per se, however, the MCP server doesn't have a pre-release track, so if we merge it (and we should be merging to main really), it will be available for everyone.

I deliberately didn't include a pre-release track on this repo because when it comes to our remote MCP, we can't have two different tracks.

@scottlovegrove
Copy link
Copy Markdown
Collaborator

any objections before I merge?

Also, you haven't updated to the pre-release version of the SDK.

In all, I would say we should wait until we are happy for all users to get this feature before we merge.

@domjost
Copy link
Copy Markdown
Author

domjost commented Apr 8, 2026

makes sense @scottlovegrove. I'll keep this open until we're ready for all users 👍🏽

@scottlovegrove scottlovegrove changed the base branch from next to main April 8, 2026 17:01
domjost and others added 9 commits April 8, 2026 22:36
Add 5 new goal tools: find-goals, add-goals, update-goals,
complete-goals, link-goal-items. Also add 'goal' to delete-object
and fetch-object entity types, GoalSchema to output-schemas,
and goal tool names to tool-names registry.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…uctions

- Replace .nullable() with "remove"/"unassign" sentinels in update-goals
  for Gemini compatibility
- Add goal tools to the instructions string in mcp-server.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Complete tool registration per AGENTS.md:
- src/index.ts: add to tools object and named exports
- scripts/run-tool.ts: add to tools record
- tool-annotations.test.ts: add annotation expectations

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Will replace hardcoded enum once the SDK is published.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- link-goal-items → link-goal-tasks
- LINK_GOAL_ITEMS → LINK_GOAL_TASKS
- linkGoalItems → linkGoalTasks
- itemIds → taskIds
- Updated all registration points

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reorganize named exports so goal tools (addGoals, completeGoals,
findGoals, linkGoalTasks, updateGoals) are grouped under one
comment block instead of scattered alphabetically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update GoalSchema progress fields to match SDK (totalTaskCount/completedTaskCount),
make progress optional, fix linkTaskToGoal/unlinkTaskFromGoal to use TaskLinkingArgs
object, and fix formatting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants