Skip to main content
Glama

get_history

Retrieve your HackMD reading history to see notes you have previously viewed. Access the list of recently read notes for quick reference.

Instructions

Get reading history

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_history' tool. It calls hackmdFetch('/history') to retrieve the user's reading history from the HackMD API.
    server.tool("get_history", "Get reading history", {}, async () => {
      try {
        return success(await hackmdFetch("/history"));
      } catch (e) {
        return error((e as Error).message);
      }
    });
  • The hackmdFetch helper that performs the actual HTTP request to the HackMD API. Called by get_history's handler to fetch '/history'.
    export async function hackmdFetch(
      path: string,
      options: { method?: string; body?: unknown } = {}
    ): Promise<unknown> {
      const { method = "GET", body } = options;
      const token = getToken();
    
      const res = await fetch(`${API_BASE}${path}`, {
        method,
        headers: {
          Authorization: `Bearer ${token}`,
          ...(body ? { "Content-Type": "application/json" } : {}),
        },
        ...(body ? { body: JSON.stringify(body) } : {}),
      });
    
      if (!res.ok) {
        const text = await res.text().catch(() => "");
        throw new Error(`HackMD API ${method} ${path} → ${res.status}: ${text}`);
      }
    
      if (res.status === 204) return { success: true };
      if (res.status === 202) return { success: true, status: "accepted" };
    
      return res.json();
    }
  • Utility helpers success() and error() used by get_history's handler to format the response (or error) returned by the tool.
    export function success(data: unknown) {
      return {
        content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
      };
    }
    
    export function error(message: string) {
      return {
        content: [{ type: "text" as const, text: JSON.stringify({ error: message }) }],
        isError: true as const,
      };
    }
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden, but it only says 'Get reading history'. It fails to disclose any behavioral traits such as whether it is read-only, requires authentication, or has side effects. This is insufficient for an agent to understand the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise at three words, but it is under-specified and does not earn its place. It lacks critical context that would make it helpful, so it is not appropriately sized for effective use.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations, output schema, and parameters, the description should provide detailed context. Instead, it offers no information about the scope, ownership, or time range of the reading history. The tool is completely underspecified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the input schema provides full coverage. The description adds no param information, but baseline is 4 for zero-parameter tools. No deduction needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get reading history' clearly states the verb (Get) and the resource (reading history), distinguishing it from sibling tools which focus on notes and teams. However, it lacks specificity about whose history or what kind of history, making it only moderately clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like get_me or get_note. The description does not mention any context or exclusion criteria, leaving the agent without direction for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/zyx1121/hackmd-mcp'

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