Skip to main content
Glama

list_notes

List all notes of the current user on HackMD. Retrieve note IDs and titles to manage your notes via API calls.

Instructions

List all notes of the current user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'list_notes' tool handler: registers the tool with no input schema, calls hackmdFetch('/notes') to list all notes for the current user, and returns the JSON result wrapped via the success helper.
    server.tool("list_notes", "List all notes of the current user", {}, async () => {
      try {
        return success(await hackmdFetch("/notes"));
      } catch (e) {
        return error((e as Error).message);
      }
    });
  • src/tools.ts:6-25 (registration)
    The registerTools function where 'list_notes' is registered on the MCP server (lines 19-25).
    export function registerTools(server: McpServer) {
      // ── User ──────────────────────────────────────────────
    
      server.tool("get_me", "Get current user profile", {}, async () => {
        try {
          return success(await hackmdFetch("/me"));
        } catch (e) {
          return error((e as Error).message);
        }
      });
    
      // ── Notes ─────────────────────────────────────────────
    
      server.tool("list_notes", "List all notes of the current user", {}, async () => {
        try {
          return success(await hackmdFetch("/notes"));
        } catch (e) {
          return error((e as Error).message);
        }
      });
  • The hackmdFetch helper: generic API client that authenticates requests to the HackMD API using HACKMD_API_TOKEN, handles errors, status codes, and returns parsed JSON.
    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();
    }
  • The success and error helper functions used to wrap tool responses in the expected MCP text content format.
    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,
      };
    }
Behavior2/5

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

No annotations exist; the description only says 'List all notes' with no mention of pagination, ordering, or any side effects, leaving behavior unclear.

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

Conciseness4/5

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

Extremely concise single sentence that is front-loaded and clear, though perhaps overly brief.

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

Completeness3/5

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

Simple tool with no parameters, but no output schema or details on pagination/ordering; given low complexity, it's adequate but could mention return format or limitations.

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?

Schema has zero parameters with 100% coverage, so no additional parameter info is needed. Description adds no extra meaning but baseline is 4 for zero parameters.

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

Purpose5/5

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

Clearly states verb 'List' and resource 'all notes of the current user', distinguishing it from sibling 'list_team_notes' which lists team notes.

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?

Provides no guidance on when to use this tool versus alternatives like 'get_note' for a specific note or 'list_team_notes' for team notes.

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