Skip to main content
Glama

delete_note

Permanently delete a HackMD note by specifying its unique note ID.

Instructions

Delete a note

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
note_idYesNote ID

Implementation Reference

  • The tool 'delete_note' is registered and its handler function deletes a note by ID via a DELETE HTTP request to the HackMD API.
    server.tool(
      "delete_note",
      "Delete a note",
      {
        note_id: z.string().min(1).describe("Note ID"),
      },
      async ({ note_id }) => {
        try {
          return success(await hackmdFetch(`/notes/${note_id}`, { method: "DELETE" }));
        } catch (e) {
          return error((e as Error).message);
        }
      }
    );
  • Input schema: the tool accepts a single required parameter 'note_id' (string, min length 1).
    server.tool(
      "delete_note",
      "Delete a note",
      {
        note_id: z.string().min(1).describe("Note ID"),
      },
  • src/tools.ts:111-124 (registration)
    Registration of 'delete_note' on the MCP server via server.tool().
    server.tool(
      "delete_note",
      "Delete a note",
      {
        note_id: z.string().min(1).describe("Note ID"),
      },
      async ({ note_id }) => {
        try {
          return success(await hackmdFetch(`/notes/${note_id}`, { method: "DELETE" }));
        } catch (e) {
          return error((e as Error).message);
        }
      }
    );
  • hackmdFetch helper: performs authenticated HTTP requests to the HackMD API, used by delete_note to issue the DELETE.
    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) } : {}),
      });
  • success and error helper functions: format the MCP tool response, used by delete_note's handler.
    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?

With no annotations, the description carries the full burden of disclosing behavioral traits. It fails to state that deletion is irreversible, requires authentication, or has side effects on related data.

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?

The description is three words long, extremely concise. While appropriate for a simple tool, a slightly more informative phrasing could be achieved without sacrificing brevity.

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

Completeness2/5

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

For a tool with no output schema, the description should reveal return values or success indicators. It provides only the operation name, leaving the agent uninformed about outcomes or errors.

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

Parameters3/5

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

Schema coverage is 100%, so the baseline is 3. The description adds no additional meaning beyond the schema's 'Note ID'; context about format or source of note_id is absent.

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

Purpose4/5

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

The description clearly states the verb 'delete' and the resource 'a note', indicating a deletion operation. However, it does not differentiate from sibling tools like 'delete_team_note', missing an opportunity to clarify scope.

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 such as 'delete_team_note' or update operations. There is no mention of prerequisites, ownership, or consequences of deletion.

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