feat(toggl): add tag CRUD tools - #59
Open
jack-arturo wants to merge 1 commit into
Open
Conversation
Co-authored-by: Madison Rickert <3495636+madisonrickert@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds full Toggl Tag CRUD support to the MCP server, including cache-backed tag listing, write operations (create/update/delete), and workspace-scoped cache invalidation after successful writes. This rounds out the existing Toggl entity/tool set (projects/clients/tasks/time entries) with tag management while keeping read paths cached and write paths safe from unintended retries.
Changes:
- Added
toggl_list_tags,toggl_create_tag,toggl_update_tag, andtoggl_delete_tagMCP tools and updated handler routing. - Extended
TogglAPIwith tag CRUD methods and response-shape normalization (raw arrays,{ items: [...] }, and single-tag responses for writes). - Added
CacheManager.invalidateWorkspaceTags()and corresponding tests; updated README andserver.jsontool listings.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tests/toggl-api.test.ts |
Adds API-level tests for tag CRUD, response normalization, and no-retry semantics for writes. |
tests/mcp-server.test.ts |
Extends mocked Toggl API + handler tests to cover tag tool schemas, validation, and end-to-end tool behavior. |
tests/cache-manager.test.ts |
Adds coverage for workspace tag cache invalidation behavior and isolation across workspaces. |
src/toggl-api.ts |
Implements tag CRUD methods plus normalization helper(s) and supports 200/empty-body success responses. |
src/index.ts |
Registers new MCP tool schemas and routes tool calls to new tag operations with cache invalidation. |
src/cache-manager.ts |
Adds invalidateWorkspaceTags() to clear workspace tag collection + related single-tag cache entries. |
server.json |
Exposes the new tag tools in the server tool manifest. |
README.md |
Documents the new tag tools and groups them under Tag Management. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+263
to
+267
| const response = await this.request<Tag[] | { items?: Tag[] }>( | ||
| 'GET', | ||
| `/workspaces/${workspaceId}/tags` | ||
| ); | ||
| return Array.isArray(response) ? response : (response.items ?? []); |
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_list_tagsplustoggl_create_tag,toggl_update_tag, andtoggl_delete_tagMCP tools.itemsenvelopes, and bare-tag responses.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