Skip to main content
Glama

update_team_note

Update a team note's content and permissions on HackMD by specifying the team path, note ID, optional new markdown content, read/write permissions, and custom permalink.

Instructions

Update a team note

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
team_pathYesTeam path
note_idYesNote ID
contentNoNew markdown content
read_permissionNoRead permission
write_permissionNoWrite permission
permalinkNoCustom permalink

Implementation Reference

  • Handler implementation for 'update_team_note'. Registers the tool with Zod schema validation (team_path, note_id, content, read_permission, write_permission, permalink) and sends a PATCH request to /teams/:team_path/notes/:note_id via hackmdFetch.
    server.tool(
      "update_team_note",
      "Update a team note",
      {
        team_path: z.string().min(1).describe("Team path"),
        note_id: z.string().min(1).describe("Note ID"),
        content: z.string().optional().describe("New markdown content"),
        read_permission: z
          .enum(["owner", "signed_in", "guest"])
          .optional()
          .describe("Read permission"),
        write_permission: z
          .enum(["owner", "signed_in", "guest"])
          .optional()
          .describe("Write permission"),
        permalink: z.string().optional().describe("Custom permalink"),
      },
      async ({ team_path, note_id, content, read_permission, write_permission, permalink }) => {
        try {
          const body: Record<string, unknown> = {};
          if (content !== undefined) body.content = content;
          if (read_permission !== undefined) body.readPermission = read_permission;
          if (write_permission !== undefined) body.writePermission = write_permission;
          if (permalink !== undefined) body.permalink = permalink;
    
          return success(
            await hackmdFetch(`/teams/${team_path}/notes/${note_id}`, { method: "PATCH", body })
          );
        } catch (e) {
          return error((e as Error).message);
        }
      }
    );
  • Zod schema for 'update_team_note' input parameters: team_path (required), note_id (required), and optional content, read_permission, write_permission, permalink.
    server.tool(
      "update_team_note",
      "Update a team note",
      {
        team_path: z.string().min(1).describe("Team path"),
        note_id: z.string().min(1).describe("Note ID"),
        content: z.string().optional().describe("New markdown content"),
        read_permission: z
          .enum(["owner", "signed_in", "guest"])
          .optional()
          .describe("Read permission"),
        write_permission: z
          .enum(["owner", "signed_in", "guest"])
          .optional()
          .describe("Write permission"),
        permalink: z.string().optional().describe("Custom permalink"),
      },
  • src/tools.ts:6-6 (registration)
    The function registerTools is called in server.ts to register all tools including 'update_team_note'.
    export function registerTools(server: McpServer) {
  • hackmdFetch helper: makes authenticated HTTP requests to HackMD API, used by the handler to send the PATCH request.
    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();
    }
  • success and error response formatters used by the handler to return MCP-compatible results.
    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, and the description does not disclose behavioral traits such as whether the update is destructive, required permissions, or any side effects. It simply states the action.

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 extremely short (4 words) but lacks necessary detail. It is under-specified for a tool with 6 parameters and does not earn its place by providing value.

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 complexity of the tool (6 parameters including permissions and custom permalink) and no output schema, the description fails to explain return values or usage context, making it incomplete.

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%, with each parameter having a description. The tool description adds no extra meaning beyond the schema, so it meets the baseline of 3 as per guidelines.

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 'Update a team note' clearly states the verb and resource, but it does not differentiate from the sibling 'update_note' tool for personal notes. The name provides distinction, but the description itself lacks explicit differentiation.

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 'create_team_note' or 'update_note'. The description is too brief to inform tool 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