UNPKG

hackmd-mcp

Version:

A Model Context Protocol server for integrating HackMD's note-taking platform with AI assistants.

27 lines (26 loc) 801 B
export function registerTeamsApiTools(server, client) { // Tool: List teams server.tool("list_teams", "List all teams accessible to the user", {}, { title: "Get a list of the teams to which the user has permission", readOnlyHint: true, openWorldHint: true, }, async () => { try { const teams = await client.getTeams(); return { content: [ { type: "text", text: JSON.stringify(teams, null, 2), }, ], }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }); }