Skip to content

feat(toggl): add client CRUD tools - #61

Open
jack-arturo wants to merge 6 commits into
feat/time-entry-task-tools-refreshfrom
feat/client-crud-refresh
Open

feat(toggl): add client CRUD tools#61
jack-arturo wants to merge 6 commits into
feat/time-entry-task-tools-refreshfrom
feat/client-crud-refresh

Conversation

@jack-arturo

Copy link
Copy Markdown
Member

Summary

  • Refreshes/supersedes feat: add client CRUD tools #40 as a maintainer branch with Madison Rickert co-author attribution preserved in the cherry-picked commits.
  • Adds toggl_create_client, toggl_update_client, and toggl_delete_client MCP tools.
  • Reuses the shared write behavior from feat(toggl): add time entry task tools #58 instead of duplicating the successful-empty-body fix.
  • Invalidates workspace client cache entries after successful client writes.
  • Adds server.json, cache, API, and MCP handler coverage for the new public tool surface.

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)
  • read-only review subagent pass with no actionable issues

Related

madisonrickert and others added 5 commits June 4, 2026 03:21
Adds createClient, updateClient, and deleteClient methods plus the
backing CreateClientRequest and UpdateClientRequest types. Toggl's PUT
endpoint requires name on every update, so UpdateClientRequest reflects
that.

Create lifted from 84emllc/mcp-toggl@eef1bea; update and delete are
added on top to round out the CRUD surface. Toggl's archive/restore
endpoints (premium-only) are intentionally out of scope for this PR.

Co-Authored-By: Andrew Miller <andrew@84em.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds invalidateWorkspaceClients so callers can drop the cached client
list and per-client 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_client, toggl_update_client, and toggl_delete_client
tool definitions and handlers. Each handler resolves the workspace, calls
the matching TogglAPI method, and invalidates cached clients for the
workspace so subsequent toggl_list_clients reflects the change.

toggl_update_client surfaces Toggl's name-required-on-PUT semantics in
its schema and runtime guard so callers do not silently null-out the
client's name.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 4, 2026 01:30

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 first-class client CRUD support to the mcp-toggl server by extending the Toggl API wrapper, exposing new MCP tools, and ensuring cache consistency after writes. This refreshes prior work by reusing the existing single-attempt write request behavior and adds test coverage across API, server handlers, and cache invalidation.

Changes:

  • Add createClient, updateClient, and deleteClient to TogglAPI, plus request types for client writes.
  • Expose toggl_create_client, toggl_update_client, toggl_delete_client MCP tools with argument validation and workspace client cache invalidation.
  • Add/extend tests and documentation to cover the new tool surface and cache behavior.

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 tests for client POST/PUT/DELETE behavior and write retry semantics.
tests/mcp-server.test.ts Extends mock API + handler tests to cover tool schemas, CRUD execution, and validation errors.
tests/cache-manager.test.ts Adds coverage verifying workspace client cache invalidation behavior.
src/types.ts Introduces CreateClientRequest / UpdateClientRequest types for client write payloads.
src/toggl-api.ts Implements client CRUD methods using single-attempt write requests.
src/index.ts Registers MCP client CRUD tools and implements handlers with input validation + cache invalidation.
src/cache-manager.ts Adds invalidateWorkspaceClients to clear workspace collections and per-client entries for a workspace.
server.json Publishes the new tool names in the server manifest.
README.md Documents the new client management tools and usage expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

fix: remove explicit any warnings
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.

3 participants