ps_scale
Adjust Heroku application dyno quantities, resize dynos for performance, view current formation, and manage resource allocation using type-specific scaling.
Instructions
Scale and resize Heroku application dynos. Use this tool when you need to: 1) Adjust dyno quantities up or down, 2) Change dyno sizes for performance, 3) View current formation details, 4) Manage resource allocation. The tool handles dyno scaling with support for type-specific adjustments.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | Yes | Name of the app to scale | |
| dyno | No | The type and quantity of dynos to scale (e.g., web=3:Standard-2X, worker+1). Omit to display current formation. |
Implementation Reference
- src/tools/ps.ts:83-93 (handler)The main handler function for the 'ps_scale' tool. It builds a 'ps:scale' command using the provided app name and optional dyno scaling argument, executes it via the Heroku REPL, and returns the processed CLI output.async (options: PsScaleOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.PS_SCALE) .addFlags({ app: options.app }) .addPositionalArguments(options.dyno ? { dyno: options.dyno } : {}) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); }
- src/tools/ps.ts:23-31 (schema)Zod schema defining the input parameters for the 'ps_scale' tool: required 'app' name and optional 'dyno' specification. Includes inferred TypeScript type.export const psScaleOptionsSchema = z.object({ app: z.string().describe('App name to scale'), dyno: z .string() .optional() .describe('Dyno type and quantity (e.g., web=3:Standard-2X, worker+1). Omit to show current formation') }); export type PsScaleOptions = z.infer<typeof psScaleOptionsSchema>;
- src/tools/ps.ts:78-95 (registration)The registration function for the 'ps_scale' tool, which calls server.tool() with the tool name, description, input schema, and handler function.export const registerPsScaleTool = (server: McpServer, herokuRepl: HerokuREPL): void => { server.tool( 'ps_scale', 'Scale Heroku app dynos. Adjust quantities, change sizes, view formation details, manage resources.', psScaleOptionsSchema.shape, async (options: PsScaleOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.PS_SCALE) .addFlags({ app: options.app }) .addPositionalArguments(options.dyno ? { dyno: options.dyno } : {}) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); } ); };
- src/index.ts:89-89 (registration)Top-level invocation of the registerPsScaleTool during MCP server initialization.ps.registerPsScaleTool(server, herokuRepl);
- src/utils/tool-commands.ts:44-44 (helper)TOOL_COMMAND_MAP constant mapping 'PS_SCALE' to the Heroku CLI command 'ps:scale', used by the CommandBuilder in the handler.PS_SCALE: 'ps:scale',