Skip to main content
Glama

get_history

Retrieve user's reading history from HackMD to track accessed notes and improve content management.

Instructions

Get user's reading history

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": {}, "type": "object" }

Implementation Reference

  • The handler function for the "get_history" tool. It fetches the user's reading history from the HackMD API client, stringifies it as JSON, and returns it as text content. Handles errors by returning an error message.
    async () => { try { const history = await client.getHistory(); return { content: [ { type: "text", text: JSON.stringify(history, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } },
  • tools/history.ts:6-33 (registration)
    Registers the "get_history" MCP tool using server.tool(), specifying the name, description, empty input schema, output hints (title, readOnlyHint, openWorldHint), and the handler function.
    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: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }, );
  • tools/index.ts:19-19 (registration)
    Invokes registerHistoryApiTools within registerAllTools to perform the tool registration for get_history (and other tools).
    registerHistoryApiTools(server, client);

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