Skip to main content
Glama

get_note

Retrieve a specific note by its ID using the HackMD MCP Server, enabling AI assistants to access and manage note content directly via the HackMD API.

Instructions

Get a note by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteIdYesNote ID

Implementation Reference

  • The handler function for the 'get_note' tool. It takes a noteId, fetches the note using the HackMD API client, and returns the note as JSON or an error message.
    async ({ noteId }) => {
      try {
        const note = await client.getNote(noteId);
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(note, null, 2),
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [{ type: "text", text: `Error: ${error.message}` }],
          isError: true,
        };
      }
    },
  • The input schema for the 'get_note' tool, requiring a 'noteId' string parameter.
    {
      noteId: z.string().describe("Note ID"),
    },
  • The registration of the 'get_note' tool using server.tool(), including name, description, input schema, metadata hints, and handler function.
    server.tool(
      "get_note",
      "Get a note by its ID",
      {
        noteId: z.string().describe("Note ID"),
      },
      {
        title: "Get a note",
        readOnlyHint: true,
        openWorldHint: true,
      },
      async ({ noteId }) => {
        try {
          const note = await client.getNote(noteId);
          return {
            content: [
              {
                type: "text",
                text: JSON.stringify(note, null, 2),
              },
            ],
          };
        } catch (error: any) {
          return {
            content: [{ type: "text", text: `Error: ${error.message}` }],
            isError: true,
          };
        }
      },
    );
  • tools/index.ts:21-21 (registration)
    Invocation of registerUserNotesApiTools within registerAllTools, which registers the 'get_note' tool (among others) to the MCP server.
    registerUserNotesApiTools(server, client);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Get a note by its ID' implies a read-only operation, but it doesn't specify whether authentication is required, what happens if the ID is invalid (e.g., error handling), or the format of the returned note. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero waste. It's front-loaded with the core purpose and appropriately sized for a simple retrieval tool. Every word earns its place without redundancy or unnecessary elaboration.

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?

Given the lack of annotations and output schema, the description is incomplete for a retrieval tool. It doesn't explain what a 'note' contains, the return format, error conditions, or authentication needs. While the tool is simple (one parameter), the description fails to provide enough context for reliable agent use without additional inference.

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?

The schema description coverage is 100%, with the single parameter 'noteId' documented as 'Note ID' in the schema. The description adds no additional meaning beyond what the schema provides (e.g., no examples, format hints, or constraints). With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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 'Get a note by its ID' clearly states the verb 'Get' and resource 'note', with the specific condition 'by its ID' that distinguishes it from list operations. However, it doesn't explicitly differentiate from sibling tools like get_history or get_user_info, which also retrieve data by ID but for different resources.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a valid note ID), when not to use it (e.g., for listing notes), or direct alternatives like list_user_notes for browsing. The agent must infer usage from the tool name and context alone.

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

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