Skip to content

feat(toggl): add tag CRUD tools - #59

Open
jack-arturo wants to merge 1 commit into
feat/time-entry-task-tools-refreshfrom
feat/tag-crud-refresh
Open

feat(toggl): add tag CRUD tools#59
jack-arturo wants to merge 1 commit into
feat/time-entry-task-tools-refreshfrom
feat/tag-crud-refresh

Conversation

@jack-arturo

@jack-arturo jack-arturo commented Jun 4, 2026

Copy link
Copy Markdown
Member

Summary

  • Refreshes/supersedes feat: add tag CRUD tools (revisits #9) #37 as a maintainer branch with Madison Rickert co-author attribution.
  • Adds cache-backed toggl_list_tags plus toggl_create_tag, toggl_update_tag, and toggl_delete_tag MCP tools.
  • Reuses the shared write behavior from feat(toggl): add time entry task tools #58 instead of duplicating the empty-success-body fix.
  • Invalidates workspace tag cache entries after successful tag writes.
  • Normalizes Toggl tag responses across raw arrays, items envelopes, and bare-tag responses.

Verification

  • npm run build
  • npm test
  • npm run test:coverage
  • npm run lint (passes with existing no-explicit-any warnings)
  • npm audit --audit-level=high (passes threshold; existing moderate brace-expansion advisory remains)

Related

Co-authored-by: Madison Rickert <3495636+madisonrickert@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 4, 2026 01:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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, and toggl_delete_tag MCP tools and updated handler routing.
  • Extended TogglAPI with tag CRUD methods and response-shape normalization (raw arrays, { items: [...] }, and single-tag responses for writes).
  • Added CacheManager.invalidateWorkspaceTags() and corresponding tests; updated README and server.json tool 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 thread src/toggl-api.ts
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 ?? []);
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.

2 participants