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
| Name | Required | Description | Default |
|---|---|---|---|
| noteId | Yes | Note ID | |
| options | Yes | Update note options | |
| teamPath | Yes | Team path |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"noteId": {
"description": "Note ID",
"type": "string"
},
"options": {
"additionalProperties": false,
"description": "Update note options",
"properties": {
"content": {
"description": "New note content",
"type": "string"
},
"permalink": {
"description": "Custom permalink",
"type": "string"
},
"readPermission": {
"description": "Read permission",
"enum": [
"owner",
"signed_in",
"guest"
],
"type": "string"
},
"writePermission": {
"description": "Write permission",
"enum": [
"owner",
"signed_in",
"guest"
],
"type": "string"
}
},
"type": "object"
},
"teamPath": {
"description": "Team path",
"type": "string"
}
},
"required": [
"teamPath",
"noteId",
"options"
],
"type": "object"
}
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);