Skip to content

feat!: replace update-thread/update-comment with unified update-object tool#182

Merged
scottlovegrove merged 2 commits intomainfrom
scottl/update-object
Apr 28, 2026
Merged

feat!: replace update-thread/update-comment with unified update-object tool#182
scottlovegrove merged 2 commits intomainfrom
scottl/update-object

Conversation

@scottlovegrove
Copy link
Copy Markdown
Collaborator

Summary

Consolidates update-thread, update-comment, and the not-yet-released update-message tool from #181 into a single update-object tool. Mirrors the existing react tool's targetType + targetId pattern.

  • targetType: "thread"client.threads.updateThread (title and/or content)
  • targetType: "comment"client.comments.updateComment (content)
  • targetType: "message"client.conversationMessages.updateMessage (content)

title is rejected at runtime for non-thread targets; content is required for comment/message; thread requires at least one of title/content (matches the prior update-thread behaviour). Annotations stay { readOnlyHint: false, destructiveHint: false, idempotentHint: true }.

The MCP outputSchema is a flat z.object with optional per-branch fields (the SDK requires a ZodRawShape and can't accept a top-level discriminated union); consumers narrow on type. The per-variant schemas (UpdateThreadOutputSchema / UpdateCommentOutputSchema / UpdateMessageOutputSchema) remain authoritative for typed construction inside the tool.

Net diff: +234 / −465 lines while broadening coverage to include conversation messages.

Breaking change

Removes the update-thread and update-comment MCP tools. The update-message tool added in #181 also never lands as a separate tool — its conversation-message support rides into this PR. Closes #181 in spirit; please close that PR manually as you noted.

Test plan

  • npm run type-check clean
  • npm run format:check clean
  • npm test — 162/162 passing, 47 snapshots, new test file covers each targetType (happy path, thread title-only / content-only / both / missing-both, comment/message missing-content, missing lastEdited, API error propagation, title rejected for non-thread)
  • npm run builddist/tools/update-object.js produced; no stale update-thread.js / update-comment.js artifacts
  • Manual MCP smoke against a dev workspace key for each targetType

🤖 Generated with Claude Code

…t tool

Consolidates the existing `update-thread` and `update-comment` tools and the
not-yet-released `update-message` tool (#181) into one `update-object` tool
that takes `targetType` ("thread" | "comment" | "message"), `targetId`,
`content`, and (for threads) `title`. Mirrors the existing `react` tool's
pattern.

BREAKING CHANGE: The `update-thread` and `update-comment` MCP tools have been
removed and replaced by `update-object`. Clients that referenced the old tool
names by string must update their tool calls.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@scottlovegrove scottlovegrove self-assigned this Apr 27, 2026
@doistbot doistbot requested a review from pawelgrimm April 27, 2026 17:20
Copy link
Copy Markdown
Member

@doistbot doistbot left a comment

Choose a reason for hiding this comment

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

This PR successfully consolidates the thread, comment, and message update tools into a single, cohesive update-object tool using the targetType pattern. The unified approach significantly reduces code duplication and provides a cleaner, broader interface for the MCP server. A couple of minor adjustments are needed, specifically registering the new tool in the scripts/run-tool.ts runner and clarifying the tool's description to reflect that the content field is optional for thread title-only updates.

Share FeedbackReview Logs

Comment thread src/index.ts
Comment thread src/tools/update-object.ts Outdated
…ptionality

Addresses PR feedback:
- scripts/run-tool.ts now registers update-object so the manual smoke
  entrypoint (`npx tsx scripts/run-tool.ts update-object ...`) works.
- Tool description spells out that `content` is required for `comment` and
  `message` and optional for `thread` when `title` is provided, so MCP
  clients/LLMs can correctly issue rename-only thread updates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@scottlovegrove scottlovegrove mentioned this pull request Apr 27, 2026
6 tasks
@scottlovegrove scottlovegrove added the 👀 Show PR PR must be reviewed before or after merging label Apr 28, 2026
@scottlovegrove scottlovegrove merged commit 82e04c0 into main Apr 28, 2026
2 checks passed
@scottlovegrove scottlovegrove deleted the scottl/update-object branch April 28, 2026 07:51
doist-release-bot Bot added a commit that referenced this pull request Apr 28, 2026
## [5.0.0](v4.7.1...v5.0.0) (2026-04-28)

### ⚠ BREAKING CHANGES

* replace update-thread/update-comment with unified update-object tool (#182)

### Features

* replace update-thread/update-comment with unified update-object tool ([#182](#182)) ([82e04c0](82e04c0))
@doist-release-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link
Copy Markdown

@pawelgrimm pawelgrimm left a comment

Choose a reason for hiding this comment

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

🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released 👀 Show PR PR must be reviewed before or after merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants