Skip to content

feat: add update-message tool#181

Closed
jgalea wants to merge 1 commit intoDoist:mainfrom
jgalea:feat/update-message-tool
Closed

feat: add update-message tool#181
jgalea wants to merge 1 commit intoDoist:mainfrom
jgalea:feat/update-message-tool

Conversation

@jgalea
Copy link
Copy Markdown
Contributor

@jgalea jgalea commented Apr 27, 2026

Summary

Adds a new update-message tool that edits an existing conversation (DM) message — fills the gap left by update-thread (covers thread bodies) and update-comment (covers thread comments). Without this, there's no way for an MCP client to correct a typo or revise a message it already sent in a 1-on-1 or group conversation, even though the underlying Twist API and @doist/twist-sdk (client.conversationMessages.updateMessage) both support it.

The tool wraps client.conversationMessages.updateMessage({ id, content }) and returns the same shape used by update-comment (text + structured output, last-edited timestamp).

Annotations: readOnlyHint: false, destructiveHint: false, idempotentHint: true — same hint profile as update-comment and update-thread.

Test plan

  • npm run type-check clean
  • npm run format:check clean
  • npm test — 162/162 passing, snapshot test added for the formatted text output
  • npm run build succeeds, dist/tools/update-message.js produced
  • New tests cover happy path, missing lastEdited, and API error propagation
  • tool-annotations.test.ts updated so the registry-coverage assertion stays in sync

Wraps client.conversationMessages.updateMessage so editing direct/group
conversation messages is possible from the MCP. update-thread and
update-comment already cover thread bodies and thread comments; this
fills the gap for conversation messages.

Tool annotations match update-comment (idempotent, non-destructive).
Includes unit tests with snapshot for the formatted text output and a
case for messages where the API returns no lastEdited timestamp.
@scottlovegrove
Copy link
Copy Markdown
Collaborator

Thanks for raising this @jgalea. I'm actually going to close it though, but in favour of #182, where I plan on bringing all the update-* tools into an update-object tool so that we don't have three near-identical tools. You can follow that PR to know when it gets merged and will be available on the remote MCP server.

@jgalea
Copy link
Copy Markdown
Contributor Author

jgalea commented Apr 27, 2026

Sounds great, that's a cleaner shape than three separate update-* tools. I see #182 is already up. Happy to review when you're ready, and to migrate or rebase the work here into the consolidated tool if that's useful.

@scottlovegrove
Copy link
Copy Markdown
Collaborator

rebase the work here into the consolidated tool if that's useful.

No need, #182 contains the functionality of this PR in it :)

@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 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants