feat(toggl): add project CRUD tools - #60
Open
jack-arturo wants to merge 6 commits into
Open
Conversation
getProject now accepts an optional workspace_id and uses the direct
GET /workspaces/{wid}/projects/{pid} endpoint, avoiding the workspace
fan-out fallback when the caller already knows the workspace. The
workspace-loop fallback remains for callers that pass only a project ID.
getProjects gains an optional active filter ('true' | 'false' | 'both')
mapping to Toggl's ?active query param.
Both improvements lifted from 84emllc/mcp-toggl@eef1bea.
Co-Authored-By: Andrew Miller <andrew@84em.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds createProject, updateProject, and deleteProject methods plus the backing CreateProjectRequest, UpdateProjectRequest, and ProjectDeleteMode type definitions. Defaults active=true and is_private=false on creation to match Toggl's documented defaults. deleteProject accepts an optional teDeletionMode controlling whether existing time entries are deleted or unassigned. Create/update lifted from 84emllc/mcp-toggl@eef1bea; delete is added on top to round out the CRUD surface. Co-Authored-By: Andrew Miller <andrew@84em.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds invalidateWorkspaceProjects so callers can drop the cached project list and per-project entries for a workspace after a write. Mirrors invalidateWorkspaceTags from the tag CRUD work in PR #37. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds toggl_create_project, toggl_update_project, and toggl_delete_project tool definitions and handlers. Each handler resolves the workspace, calls the matching TogglAPI method, and invalidates cached projects for the workspace so subsequent toggl_list_projects reflects the change. toggl_delete_project surfaces Toggl's optional teDeletionMode query parameter as 'time_entry_deletion_mode' so callers can choose between deleting the project's time entries or detaching them. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds full project write support (create/update/delete) to the Toggl MCP server, extending the existing cached read surface with validated write handlers and cache invalidation so project listings reflect writes immediately.
Changes:
- Added
toggl_create_project,toggl_update_project, andtoggl_delete_projectMCP tools with argument validation and write-oriented annotations. - Extended
TogglAPIwith project CRUD methods and improvedgetProjectlookup (direct workspace endpoint whenworkspaceIdis known; workspace-fallback otherwise). - Implemented and tested workspace-scoped project cache invalidation after successful project writes; updated docs and server manifest.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/toggl-api.test.ts |
Adds API-level coverage for project CRUD, direct lookup, fallback behavior, and no-retry write semantics. |
tests/mcp-server.test.ts |
Validates new tool schemas and end-to-end handler behavior (success + INVALID_ARGUMENT paths) for project tools. |
tests/cache-manager.test.ts |
Adds coverage ensuring workspace project invalidation clears the right cache entries and forces refetch. |
src/types.ts |
Introduces request/enum types for project create/update/delete inputs. |
src/toggl-api.ts |
Implements project CRUD methods, active filter option for getProjects, and improved getProject lookup behavior. |
src/index.ts |
Exposes new MCP tools + handlers, validates inputs, and invalidates project cache after writes. |
src/cache-manager.ts |
Adds invalidateWorkspaceProjects() to clear per-workspace collections and per-project entries for that workspace. |
server.json |
Registers the new public tool names/descriptions in the server manifest. |
README.md |
Documents the new Project Management tools and their key parameters/semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
toggl_create_project,toggl_update_project, andtoggl_delete_projectMCP tools.server.json, cache, API, and MCP handler coverage for the new public tool surface.Verification
npm run buildnpm testnpm run test:coveragenpm run lint(passes with existingno-explicit-anywarnings)npm audit --audit-level=high(passes threshold; existing moderatebrace-expansionadvisory remains)Related
feat/time-entry-task-tools-refresh