list_teams
View and manage Heroku team memberships, access metadata, and verify enterprise relationships. Output team details in simplified text or detailed JSON format for app operations and membership verification.
Instructions
List Heroku Teams the user belongs to. Use this tool when you need to: 1) View all accessible teams, 2) Check team membership, 3) Get team metadata and enterprise relationships, or 4) Verify team access for app operations. Supports JSON output for detailed team information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| json | No | Controls the output format. When true, returns a detailed JSON response containing team metadata such as enterprise account name. When false or omitted, returns a simplified text format. |
Implementation Reference
- src/tools/teams.ts:43-48 (handler)Handler function that builds and executes the 'heroku teams' CLI command based on options and processes the output.async (options: ListTeamsOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.LIST_TEAMS).addFlags({ json: options.json }).build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); }
- src/tools/teams.ts:17-22 (schema)Zod schema defining optional 'json' input parameter for controlling output format.export const listTeamsOptionsSchema = z.object({ json: z .boolean() .optional() .describe('Output format control - true for detailed JSON with team metadata, false/omitted for simplified text') });
- src/tools/teams.ts:38-50 (registration)Registration function that adds the 'list_teams' tool to the MCP server, including name, description, schema, and handler.export const registerListTeamsTool = (server: McpServer, herokuRepl: HerokuREPL): void => { server.tool( 'list_teams', 'Lists accessible Heroku Teams. Use for: viewing teams, checking membership, getting team metadata, and verifying access. JSON output available.', listTeamsOptionsSchema.shape, async (options: ListTeamsOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.LIST_TEAMS).addFlags({ json: options.json }).build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); } ); };
- src/index.ts:66-66 (registration)Invocation of the registerListTeamsTool during MCP server setup.teams.registerListTeamsTool(server, herokuRepl);
- src/utils/tool-commands.ts:21-21 (helper)TOOL_COMMAND_MAP constant mapping 'LIST_TEAMS' to the Heroku CLI 'teams' command.LIST_TEAMS: 'teams',