Add parentFolderId option to create_note and update_note#10
Open
inwoodev wants to merge 1 commit into
Open
Conversation
The HackMD REST API and @hackmd/api support a `parentFolderId` field on both create and update, and the note tools already forward the whole payload to the client. Exposing it in CreateNoteOptionsSchema and UpdateNoteOptionsSchema lets MCP clients file a note into a folder on creation (and move it via update). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Adds an optional
parentFolderId(string) field toCreateNoteOptionsSchemaandUpdateNoteOptionsSchema.Why
The HackMD REST API and
@hackmd/apiv2.5.0 both acceptparentFolderIdon create and update (it's inCreateNoteOptions/UpdateNoteOptions). The note tools already forward the entirepayload/optionsobject toclient.createNote/client.updateNote, so the only thing preventing MCP clients from placing a note in a folder is that the two zod schemas don't expose the field.Change
Two fields — one per schema:
Verification
Built with
tsc(no type errors). Ran the built server over stdio and confirmedcreate_note/update_noteadvertisepayload.parentFolderId, then end-to-end against a real account:create_notewithparentFolderIdfiles the new note into that folder and it appears there in the HackMD web UI.Note: setting
parentFolderIdon create (POST) places the note in the folder and is reflected in the HackMD web UI. Setting it on update (PATCH) of an existing note updates the note'sfolderPathsmetadata but, in my testing, the HackMD web UI's folder tree does not reflect the move — this appears to be a HackMD API/UI limitation (the UI tree is backed by an internal Yjs preferences structure the public API doesn't write), not something this change can address. Exposing the field on update is still useful for parity and metadata correctness.🤖 Generated with Claude Code