delete_note
Remove a specific note from HackMD by providing its unique note ID using the MCP server's functionality.
Instructions
Delete a note
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| noteId | Yes | Note ID |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"noteId": {
"description": "Note ID",
"type": "string"
}
},
"required": [
"noteId"
],
"type": "object"
}
Implementation Reference
- tools/userNotes.ts:155-172 (handler)The handler function that executes the delete_note tool. It calls client.deleteNote(noteId) and formats a success or error response.async ({ noteId }) => { try { const result = await client.deleteNote(noteId); return { content: [ { type: "text", text: `Note ${noteId} deleted successfully:\n${JSON.stringify(result, null, 2)}`, }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } },
- tools/userNotes.ts:145-147 (schema)Zod input schema for the delete_note tool, requiring a noteId string parameter.{ noteId: z.string().describe("Note ID"), },
- tools/userNotes.ts:142-173 (registration)Full registration of the delete_note tool using server.tool(), including name, description, schema, hints, and inline handler.server.tool( "delete_note", "Delete a note", { noteId: z.string().describe("Note ID"), }, { title: "Delete a note", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true, }, async ({ noteId }) => { try { const result = await client.deleteNote(noteId); return { content: [ { type: "text", text: `Note ${noteId} deleted successfully:\n${JSON.stringify(result, null, 2)}`, }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }, );