twprojects-create_comment cannot post private comments
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 25
- Forks
- 18
- Avg merge
- 1h 41m
- Merged PRs (30d)
- 67
Description
Summary
The Projects comment tool (twprojects-create_comment, and twprojects-update_comment) provides no way to mark a comment private. Teamwork's product supports comment privacy, and the Spaces side of this repo already exposes it (twspaces-create_comment has an isPrivate param — internal/twspaces/comments.go:152), but the Projects equivalent never got it.
This blocks a common workflow: keeping development/internal comments private until they're ready for a client to review.
Current state
Privacy is absent at two layers:
- MCP tool —
internal/twprojects/comments.goexposes onlyobject,body,content_type,notify_current_user,notify. - SDK —
projects.CommentCreateRequest/CommentUpdateRequest(teamwork/twapi-go-sdk) carry onlyBody,ContentType,NotifyCurrentUser,Notify, so the typed struct the tool marshals can't carry a privacy flag. - API —
CommentCreatePOSTs to the v1 endpoint/{resource}/{id}/comments.jsonwith{"comment":{…}}. The v1 comment object carries aprivatefield, and the product supports choosing who a comment is private to (support docs), so the capability exists in the API — it's just not surfaced.
Proposed change
Prerequisite — SDK (teamwork/twapi-go-sdk):
- Confirm the exact v1 param (historically
isprivate0/1; verify whether privacy also accepts a user/company-ID recipient list). - Add the field(s) to
CommentCreateRequestandCommentUpdateRequestwithomitempty. - Add SDK tests; tag a release; bump
go.modin this repo.
This repo (internal/twprojects/comments.go):
- Add a
privateparam toCommentCreate'sInputSchema, mirroring thetwspacesisPrivatestyle (AnyOf: [boolean, null]). If the API supports targeted recipients, model that with the existinghelpers.UserGroupsSchemapattern already used fornotify. - Wire it through the handler via
helpers.OptionalPointerParam. - Mirror on
CommentUpdate. - Update the tool description to mention privacy.
- Add tests in
comments_test.goasserting the privacy field serializes into the request body (using the existingmcpServerMock/toolRequesthelpers).
Notes
The MCP tool change is blocked on the SDK release. An alternative that avoids the SDK dependency — having the handler POST a raw request body directly — was considered but rejected as it runs against the repo's typed-SDK conventions.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read internal/twprojects/comments.go and compare its comment handlers with internal/twspaces/comments.go:152, then inspect the teamwork/twapi-go-sdk request structs and API parameter conventions. Run the existing comments_test.go patterns with mcpServerMock and toolRequest after confirming the v1 privacy parameter. Done means create and update tools serialize privacy fields and the SDK tests and dependency update are complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100