Skip to content

Conversation

@scottlovegrove
Copy link
Contributor

@scottlovegrove scottlovegrove commented Dec 19, 2025

Summary

Add a new fetch-object tool that allows fetching individual Todoist objects (tasks, projects, comments, sections) directly by their ID. This complements existing find-* tools by providing a simpler interface when the object ID is already known.

Why a new tool instead of extending fetch?

The existing fetch tool is designed for OpenAI MCP spec compliance:

  • Uses composite ID format ("task:123", "project:456")
  • Returns MCP document format (id, title, text, url, metadata)
  • Only supports tasks and projects (MCP spec limitation)
  • Optimized for OpenAI MCP consumers

The new fetch-object tool provides a cleaner, more flexible API:

  • Separate type and id parameters (more intuitive)
  • Returns full typed objects with all fields
  • Supports all object types including comments and sections
  • Better for general programmatic use by AI agents

Keeping them separate maintains MCP spec compliance for fetch while providing a more powerful general-purpose tool for direct object retrieval.

Changes

  • New tool:
    • Supports fetching tasks, projects, comments, and sections by ID
    • Returns both human-readable text content and structured typed data
    • Follows existing tool patterns and conventions

Use Case

This tool is particularly useful for AI agents that:

  • Have an object ID from a previous operation
  • Want to retrieve full details without complex search operations
  • Need direct ID-based retrieval rather than filtered searches

Test Results

✅ All 363 tests pass
✅ Type-check: No errors
✅ Linting: All checks pass
✅ Schema validation: Gemini API compatible

🤖 Generated with Claude Code

Add a new fetch-object tool that allows fetching individual Todoist objects (tasks, projects, comments, sections) directly by their ID. This complements existing find-* tools by providing a simpler interface when the object ID is already known.

Features:
- Fetch tasks, projects, comments, or sections by ID
- Returns both human-readable text and structured typed data
- Comprehensive test coverage (13 tests)
- Follows existing tool patterns and conventions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
scottlovegrove and others added 2 commits December 19, 2025 17:29
Change section tests to use the direct getSection(id) method instead of
getSections() with client-side filtering. This matches the corrected
implementation that uses the Todoist SDK's getSection method.

- Updated mock from getSections to getSection
- Changed mock return values from array to single object
- Simplified tests by removing redundant test case
- Now 12 tests (was 13)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@scottlovegrove scottlovegrove self-assigned this Dec 19, 2025
@scottlovegrove scottlovegrove added the Show PR is shipped with an async review label Dec 19, 2025
@scottlovegrove scottlovegrove merged commit b2f7c2e into main Dec 19, 2025
2 checks passed
@scottlovegrove scottlovegrove deleted the scottl/fetch-object branch December 19, 2025 17:54
@henningmu
Copy link
Collaborator

@scottlovegrove @gnapse what are your thoughts on making this plural fetch-objects and accepting an array of composite IDs?

One use case is when using find-tasks-by-date we have a list of tasks with just project IDs. Now we need to call fetch-object for each project ID separately. Would be much simpler to just dump all IDs into a single tool call 🤔

@scottlovegrove
Copy link
Contributor Author

The problem is the Todoist api not being built to do that. We'd have to either revert to using the sync api for this tool, or we'd potentially have to put in delays to avoid being rate limited.

@henningmu
Copy link
Collaborator

I thought it might be beneficial to hide the complexity of multiple API calls in the tool is better than pushing it on the consumer of the tools. But you're right it makes a lot of things more complex, e.g. partial failure scenarios :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Show PR is shipped with an async review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants