Skip to main content
Glama

update_note

Modify an existing note on HackMD by updating its content, permalink, read, or write permissions using the note ID and new payload.

Instructions

Update an existing note

Input Schema

NameRequiredDescriptionDefault
noteIdYesNote ID
payloadYesUpdate note options

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "noteId": { "description": "Note ID", "type": "string" }, "payload": { "additionalProperties": false, "description": "Update note options", "properties": { "content": { "description": "New note content", "type": "string" }, "permalink": { "description": "Custom permalink", "type": "string" }, "readPermission": { "description": "Read permission", "enum": [ "owner", "signed_in", "guest" ], "type": "string" }, "writePermission": { "description": "Write permission", "enum": [ "owner", "signed_in", "guest" ], "type": "string" } }, "type": "object" } }, "required": [ "noteId", "payload" ], "type": "object" }

Implementation Reference

  • The handler function that implements the core logic of the 'update_note' tool by calling the HackMD API's updateNote method and formatting the response.
    async ({ noteId, payload }) => { try { const result = await client.updateNote(noteId, payload); return { content: [ { type: "text", text: `Note ${noteId} updated successfully:\n${JSON.stringify(result, null, 2)}`, }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; }
  • Zod schema defining the payload options for updating a note, including content, permissions, and permalink.
    export const UpdateNoteOptionsSchema = z.object({ content: z.string().optional().describe("New note content"), readPermission: z .enum([ NotePermissionRole.OWNER, NotePermissionRole.SIGNED_IN, NotePermissionRole.GUEST, ]) .optional() .describe("Read permission"), writePermission: z .enum([ NotePermissionRole.OWNER, NotePermissionRole.SIGNED_IN, NotePermissionRole.GUEST, ]) .optional() .describe("Write permission"), permalink: z.string().optional().describe("Custom permalink"), });
  • MCP server tool registration for 'update_note', including tool name, description, input schema, and metadata hints.
    server.tool( "update_note", "Update an existing note", { noteId: z.string().describe("Note ID"), payload: UpdateNoteOptionsSchema.describe("Update note options"), }, { title: "Update a note", readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true, },

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yuna0x0/hackmd-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server