delete_team_note
Remove a note from a HackMD team by providing the team path and note ID.
Instructions
Delete a team note
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| team_path | Yes | Team path | |
| note_id | Yes | Note ID |
Implementation Reference
- src/tools.ts:231-247 (handler)Handler for 'delete_team_note' tool: accepts team_path and note_id, sends a DELETE request to /teams/{team_path}/notes/{note_id} via hackmdFetch, and returns success or error.
server.tool( "delete_team_note", "Delete a team note", { team_path: z.string().min(1).describe("Team path"), note_id: z.string().min(1).describe("Note ID"), }, async ({ team_path, note_id }) => { try { return success( await hackmdFetch(`/teams/${team_path}/notes/${note_id}`, { method: "DELETE" }) ); } catch (e) { return error((e as Error).message); } } ); - src/tools.ts:231-247 (registration)Registration of 'delete_team_note' tool on the MCP server with Zod schema validation (team_path and note_id as required strings). The tool is registered alongside other team note CRUD operations.
server.tool( "delete_team_note", "Delete a team note", { team_path: z.string().min(1).describe("Team path"), note_id: z.string().min(1).describe("Note ID"), }, async ({ team_path, note_id }) => { try { return success( await hackmdFetch(`/teams/${team_path}/notes/${note_id}`, { method: "DELETE" }) ); } catch (e) { return error((e as Error).message); } } ); - src/tools.ts:1-4 (helper)Imports: hackmdFetch from './api.js' handles the actual HTTP requests; success and error from './helpers.js' format MCP tool responses.
import { z } from "zod"; import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { hackmdFetch } from "./api.js"; import { success, error } from "./helpers.js";