feat: add update-message tool#181
Conversation
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.
|
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 |
|
Sounds great, that's a cleaner shape than three separate |
No need, #182 contains the functionality of this PR in it :) |
|
🎉 This PR is included in version 5.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Adds a new
update-messagetool that edits an existing conversation (DM) message — fills the gap left byupdate-thread(covers thread bodies) andupdate-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 byupdate-comment(text + structured output, last-edited timestamp).Annotations:
readOnlyHint: false,destructiveHint: false,idempotentHint: true— same hint profile asupdate-commentandupdate-thread.Test plan
npm run type-checkcleannpm run format:checkcleannpm test— 162/162 passing, snapshot test added for the formatted text outputnpm run buildsucceeds,dist/tools/update-message.jsproducedlastEdited, and API error propagationtool-annotations.test.tsupdated so the registry-coverage assertion stays in sync