Skip to main content
Glama

create_team_note

Generate and manage collaborative notes within a team on HackMD by specifying title, content, permissions, and custom permalink.

Instructions

Create a new note in a team

Input Schema

NameRequiredDescriptionDefault
payloadYesCreate note options
teamPathYesTeam path

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "payload": { "additionalProperties": false, "description": "Create note options", "properties": { "commentPermission": { "description": "Comment permission", "enum": [ "disabled", "forbidden", "owners", "signed_in_users", "everyone" ], "type": "string" }, "content": { "description": "Note content", "type": "string" }, "permalink": { "description": "Custom permalink", "type": "string" }, "readPermission": { "description": "Read permission", "enum": [ "owner", "signed_in", "guest" ], "type": "string" }, "title": { "description": "Note title", "type": "string" }, "writePermission": { "description": "Write permission", "enum": [ "owner", "signed_in", "guest" ], "type": "string" } }, "type": "object" }, "teamPath": { "description": "Team path", "type": "string" } }, "required": [ "teamPath", "payload" ], "type": "object" }

Implementation Reference

  • The handler function that implements the core logic of the 'create_team_note' tool by calling the HackMD API client to create a team note.
    async ({ teamPath, payload }) => { try { const note = await client.createTeamNote(teamPath, payload); return { content: [ { type: "text", text: `Team note created successfully:\n${JSON.stringify(note, null, 2)}`, }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } },
  • Zod schema for note creation options (payload parameter in create_team_note tool).
    export const CreateNoteOptionsSchema = z.object({ title: z.string().optional().describe("Note title"), content: z.string().optional().describe("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"), commentPermission: z .enum([ CommentPermissionType.DISABLED, CommentPermissionType.FORBIDDEN, CommentPermissionType.OWNERS, CommentPermissionType.SIGNED_IN_USERS, CommentPermissionType.EVERYONE, ]) .optional() .describe("Comment permission"), permalink: z.string().optional().describe("Custom permalink"), });
  • Registration of the 'create_team_note' MCP tool using server.tool(), defining name, description, input schema, hints, and handler.
    server.tool( "create_team_note", "Create a new note in a team", { teamPath: z.string().describe("Team path"), payload: CreateNoteOptionsSchema.describe("Create note options"), }, { title: "Create a note in a Team workspace", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true, }, async ({ teamPath, payload }) => { try { const note = await client.createTeamNote(teamPath, payload); return { content: [ { type: "text", text: `Team note created successfully:\n${JSON.stringify(note, null, 2)}`, }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }, );
  • tools/index.ts:20-20 (registration)
    Invocation of registerTeamNotesApiTools which includes registration of create_team_note.
    registerTeamNotesApiTools(server, client);
  • index.ts:132-132 (registration)
    Top-level call to registerAllTools, which chains to registration of create_team_note tool.
    registerAllTools(server, client);

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