update_team_note
Modify team notes in HackMD by updating content, permissions, or custom permalinks using the specified note ID and team path. Simplifies collaborative note management.
Instructions
Update an existing note in a team
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| noteId | Yes | Note ID | |
| options | Yes | Update note options | |
| teamPath | Yes | Team path |
Implementation Reference
- tools/teamNotes.ts:93-110 (handler)The handler function for the 'update_team_note' tool. It takes teamPath, noteId, and options, calls client.updateTeamNote, and returns a formatted success message or error.async ({ teamPath, noteId, options }) => { try { const result = await client.updateTeamNote(teamPath, noteId, options); return { content: [ { type: "text", text: `Team note ${noteId} updated successfully:\n${JSON.stringify(result, null, 2)}`, }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } },
- tools/teamNotes.ts:78-92 (registration)Registers the 'update_team_note' tool on the MCP server, specifying name, description, input schema, and metadata hints.server.tool( "update_team_note", "Update an existing note in a team", { teamPath: z.string().describe("Team path"), noteId: z.string().describe("Note ID"), options: UpdateNoteOptionsSchema.describe("Update note options"), }, { title: "Update a note in a Team's workspace", readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true, },
- utils/schemas.ts:61-80 (schema)Zod schema defining the 'options' parameter for the update_team_note tool, including content, permissions, and permalink.export const UpdateNoteOptionsSchema = z.object({ content: z.string().optional().describe("New note content"), readPermission: z .enum([ NotePermissionRole.OWNER, NotePermissionRole.SIGNED_IN, NotePermissionRole.GUEST, ]) .optional() .describe("Read permission"), writePermission: z .enum([ NotePermissionRole.OWNER, NotePermissionRole.SIGNED_IN, NotePermissionRole.GUEST, ]) .optional() .describe("Write permission"), permalink: z.string().optional().describe("Custom permalink"), });
- tools/index.ts:20-20 (registration)Calls registerTeamNotesApiTools which includes the registration of update_team_note, as part of registering all tools.registerTeamNotesApiTools(server, client);