maintenance_on
Activate maintenance mode for Heroku apps to redirect traffic, schedule updates, and manage service interruptions. Ensures smooth transitions during deployments or planned maintenance windows.
Instructions
Enable maintenance mode for Heroku applications. Use this tool when you need to: 1) Redirect traffic to a maintenance page, 2) Prepare for system updates or deployments, 3) Schedule planned maintenance windows, 4) Gracefully handle service interruptions. The tool manages traffic routing and process states while preserving running operations.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | Yes | The name of the Heroku app to modify maintenance mode for. This must be an existing app that you have access to. |
Implementation Reference
- src/tools/maintenance.ts:36-45 (handler)The handler function for the 'maintenance_on' tool. It builds a Heroku CLI command using CommandBuilder with the MAINTENANCE_ON command and the app flag, executes it via herokuRepl, and processes the output with handleCliOutput.async (options: MaintenanceModeOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.MAINTENANCE_ON) .addFlags({ app: options.app }) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); }
- src/tools/maintenance.ts:14-16 (schema)Zod schema for input validation of the maintenance_on tool, requiring an 'app' string parameter.export const maintenanceModeOptionsSchema = z.object({ app: z.string().describe('Target Heroku app name') });
- src/tools/maintenance.ts:31-47 (registration)The registration function for the maintenance_on tool, which calls server.tool to register the handler, schema, and description.export const registerMaintenanceOnTool = (server: McpServer, herokuRepl: HerokuREPL): void => { server.tool( 'maintenance_on', 'Enable maintenance mode and redirect traffic for a Heroku app', maintenanceModeOptionsSchema.shape, async (options: MaintenanceModeOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.MAINTENANCE_ON) .addFlags({ app: options.app }) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); } ); };
- src/index.ts:56-56 (registration)Invocation of the registerMaintenanceOnTool during MCP server initialization.maintenance.registerMaintenanceOnTool(server, herokuRepl);
- src/utils/tool-commands.ts:14-14 (helper)TOOL_COMMAND_MAP constant providing the Heroku CLI command string for maintenance_on.MAINTENANCE_ON: 'maintenance:on',