ps_restart
Restart Heroku application processes with precision—target specific dynos, process types, or perform full application restarts to reset states and ensure smooth operation.
Instructions
Restart Heroku application processes. Use this tool when you need to: 1) Restart specific dynos by name, 2) Restart all dynos of a process type, 3) Perform full application restarts, 4) Reset dyno states selectively. The tool manages process restarts with flexible targeting options.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | Yes | Name of the app to restart processes for | |
| dyno-name | No | Specific dyno to restart (e.g., web.1). If neither dyno-name nor process-type specified, restarts all dynos | |
| process-type | No | Type of dynos to restart (e.g., web). If neither dyno-name nor process-type specified, restarts all dynos |
Implementation Reference
- src/tools/ps.ts:108-119 (handler)The handler function for the 'ps_restart' tool. It constructs a 'ps:restart' Heroku CLI command using the input options (app, dyno-name, process-type) and executes it via the HerokuREPL, returning the handled CLI output.async (options: PsRestartOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.PS_RESTART) .addFlags({ app: options.app, 'dyno-name': options['dyno-name'], 'process-type': options['process-type'] }) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); }
- src/tools/ps.ts:36-43 (schema)Zod schema defining the input parameters for the 'ps_restart' tool: app (required), dyno-name (optional), process-type (optional).export const psRestartOptionsSchema = z.object({ app: z.string().describe('App name to restart processes for'), 'dyno-name': z .string() .optional() .describe('Specific dyno to restart (e.g., web.1). Omit both options to restart all'), 'process-type': z.string().optional().describe('Dyno type to restart (e.g., web). Omit both options to restart all') });
- src/tools/ps.ts:103-121 (registration)Registration function that calls server.tool to register the 'ps_restart' tool with name, description, input schema, and handler function.export const registerPsRestartTool = (server: McpServer, herokuRepl: HerokuREPL): void => { server.tool( 'ps_restart', 'Restart Heroku app processes. Restart specific dynos, process types, or all dynos. Reset dyno states selectively.', psRestartOptionsSchema.shape, async (options: PsRestartOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.PS_RESTART) .addFlags({ app: options.app, 'dyno-name': options['dyno-name'], 'process-type': options['process-type'] }) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); } ); };
- src/index.ts:90-90 (registration)Invocation of the registerPsRestartTool function during server initialization to register the tool.ps.registerPsRestartTool(server, herokuRepl);
- src/utils/tool-commands.ts:45-45 (helper)Constant mapping for the 'PS_RESTART' tool command to the Heroku CLI command 'ps:restart'.PS_RESTART: 'ps:restart',