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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_teams"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
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);