FEATURE: add support for post editing#45
Merged
Conversation
Add discourse_update_post tool to edit existing post content via PUT /posts/:post_id.json with optional edit_reason parameter. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Grubba27
approved these changes
Mar 31, 2026
Grubba27
reviewed
Mar 31, 2026
Comment on lines
+15
to
+24
| server.registerTool( | ||
| "discourse_update_post", | ||
| { | ||
| title: "Update Post", | ||
| description: "Update the content of an existing post. Returns JSON with updated post details.", | ||
| inputSchema: schema.shape, | ||
| }, | ||
| async (args, _extra) => { | ||
| try { | ||
| const { post_id, raw, edit_reason } = schema.parse(args); |
There was a problem hiding this comment.
Not in scope, but more of a general question, would it make sense for registerTool to do the schema.parse before getting in here?
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
discourse_update_posttool to edit existing post content viaPUT /posts/:post_id.jsonpost_id,raw(markdown content), and optionaledit_reasonparameters