Skip to main content
Glama
heroku

Heroku MCP server

Official
by heroku

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
NameRequiredDescriptionDefault
appYesName of the app to restart processes for
dyno-nameNoSpecific dyno to restart (e.g., web.1). If neither dyno-name nor process-type specified, restarts all dynos
process-typeNoType of dynos to restart (e.g., web). If neither dyno-name nor process-type specified, restarts all dynos

Implementation Reference

  • 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); }
  • 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') });
  • 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);
  • Constant mapping for the 'PS_RESTART' tool command to the Heroku CLI command 'ps:restart'.
    PS_RESTART: 'ps:restart',

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/heroku/heroku-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server