feat!: replace update-thread/update-comment with unified update-object tool#182
Merged
scottlovegrove merged 2 commits intomainfrom Apr 28, 2026
Merged
feat!: replace update-thread/update-comment with unified update-object tool#182scottlovegrove merged 2 commits intomainfrom
scottlovegrove merged 2 commits intomainfrom
Conversation
…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>
doistbot
reviewed
Apr 27, 2026
Member
doistbot
left a comment
There was a problem hiding this comment.
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.
…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>
6 tasks
Contributor
|
🎉 This PR is included in version 5.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
Consolidates
update-thread,update-comment, and the not-yet-releasedupdate-messagetool from #181 into a singleupdate-objecttool. Mirrors the existingreacttool'stargetType+targetIdpattern.targetType: "thread"→client.threads.updateThread(titleand/orcontent)targetType: "comment"→client.comments.updateComment(content)targetType: "message"→client.conversationMessages.updateMessage(content)titleis rejected at runtime for non-thread targets;contentis required for comment/message; thread requires at least one oftitle/content(matches the priorupdate-threadbehaviour). Annotations stay{ readOnlyHint: false, destructiveHint: false, idempotentHint: true }.The MCP
outputSchemais a flatz.objectwith optional per-branch fields (the SDK requires aZodRawShapeand can't accept a top-level discriminated union); consumers narrow ontype. 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-threadandupdate-commentMCP tools. Theupdate-messagetool 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-checkcleannpm run format:checkcleannpm test— 162/162 passing, 47 snapshots, new test file covers eachtargetType(happy path, thread title-only / content-only / both / missing-both, comment/message missing-content, missinglastEdited, API error propagation,titlerejected for non-thread)npm run build—dist/tools/update-object.jsproduced; no staleupdate-thread.js/update-comment.jsartifactstargetType🤖 Generated with Claude Code