UNPKG

hackmd-mcp

Version:

A Model Context Protocol server for integrating HackMD's note-taking platform with AI assistants.

27 lines (26 loc) 783 B
export function registerHistoryApiTools(server, client) { // Tool: Get user's read history server.tool("get_history", "Get user's reading history", {}, { title: "Get a history of read notes", readOnlyHint: true, openWorldHint: true, }, async () => { try { const history = await client.getHistory(); return { content: [ { type: "text", text: JSON.stringify(history, null, 2), }, ], }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }); }