list_user_notes
Retrieve all notes owned by the user using the HackMD API. This tool helps organize and manage personal notes efficiently through the MCP server.
Instructions
List all notes owned by the user
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- tools/userNotes.ts:20-37 (handler)The handler function that implements the list_user_notes tool. It fetches the user's notes using the HackMD API client.getNoteList(), stringifies them as JSON, and returns as text content block. Handles errors by returning an error message.async () => { try { const notes = await client.getNoteList(); return { content: [ { type: "text", text: JSON.stringify(notes, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } },
- tools/userNotes.ts:11-38 (registration)Registers the list_user_notes tool with the MCP server, specifying name, description, empty input schema, output hints (read-only, open-world), and attaches the handler function.server.tool( "list_user_notes", "List all notes owned by the user", {}, { title: "Get a list of notes in the user's workspace", readOnlyHint: true, openWorldHint: true, }, async () => { try { const notes = await client.getNoteList(); return { content: [ { type: "text", text: JSON.stringify(notes, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }, );
- tools/index.ts:21-21 (registration)Top-level call to register all user notes tools, including list_user_notes, within the registerAllTools function.registerUserNotesApiTools(server, client);