list_teams
Retrieve a list of all teams accessible to the user on the HackMD platform, enabling efficient team management and collaboration.
Instructions
List all teams accessible to the user
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- tools/teams.ts:15-32 (handler)Handler function that fetches teams using client.getTeams() and returns formatted JSON or error message.async () => { try { const teams = await client.getTeams(); return { content: [ { type: "text", text: JSON.stringify(teams, null, 2), }, ], }; } catch (error: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } },
- tools/teams.ts:7-33 (registration)Registers the 'list_teams' tool on the MCP server with name, description, empty input schema, metadata hints, and inline handler."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: any) { return { content: [{ type: "text", text: `Error: ${error.message}` }], isError: true, }; } }, );
- tools/index.ts:18-18 (registration)Calls registerTeamsApiTools within registerAllTools to register the teams tools including list_teams.registerTeamsApiTools(server, client);