Skip to content

Add parentFolderId option to create_note and update_note#10

Open
inwoodev wants to merge 1 commit into
yuna0x0:mainfrom
inwoodev:add-note-parentFolderId
Open

Add parentFolderId option to create_note and update_note#10
inwoodev wants to merge 1 commit into
yuna0x0:mainfrom
inwoodev:add-note-parentFolderId

Conversation

@inwoodev

Copy link
Copy Markdown

What

Adds an optional parentFolderId (string) field to CreateNoteOptionsSchema and UpdateNoteOptionsSchema.

Why

The HackMD REST API and @hackmd/api v2.5.0 both accept parentFolderId on create and update (it's in CreateNoteOptions / UpdateNoteOptions). The note tools already forward the entire payload/options object to client.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:

parentFolderId: z.string().optional().describe("ID of the folder to place the note in"),

Verification

Built with tsc (no type errors). Ran the built server over stdio and confirmed create_note/update_note advertise payload.parentFolderId, then end-to-end against a real account: create_note with parentFolderId files the new note into that folder and it appears there in the HackMD web UI.

Note: setting parentFolderId on 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's folderPaths metadata 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

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>
@yuna0x0 yuna0x0 self-assigned this Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants