rename_app
Change the name of a Heroku application or resolve naming conflicts by providing the current app name and a unique new name. Validates availability and manages the renaming process.
Instructions
Rename an existing Heroku application. Use this tool when a user needs to: 1) Change an app's name, or 2) Resolve naming conflicts. Requires both current app name and desired new name. The tool validates name availability and handles the rename process.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | Yes | The current name of the Heroku app you want to rename. This must be an existing app that you have access to. | |
| newName | Yes | The new name you want to give to the app. Must be unique across all Heroku apps. |
Implementation Reference
- src/tools/apps.ts:156-164 (handler)The asynchronous handler function that constructs a CommandBuilder for the 'apps:rename' Heroku CLI command using the provided app name and new name, executes it via the Heroku REPL, and processes the output.async (options: RenameAppOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.RENAME_APP) .addFlags({ app: options.app }) .addPositionalArguments({ newName: options.newName }) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); }
- src/tools/apps.ts:135-138 (schema)Zod schema defining the input parameters for the rename_app tool: 'app' (current app name) and 'newName' (desired new app name).export const renameAppOptionsSchema = z.object({ app: z.string().describe('Current app name. Requires access'), newName: z.string().describe('New unique app name') });
- src/tools/apps.ts:151-166 (registration)Function that registers the 'rename_app' tool on the MCP server, providing the tool name, description, input schema, and handler function.export const registerRenameAppTool = (server: McpServer, herokuRepl: HerokuREPL): void => { server.tool( 'rename_app', 'Rename app: validate and update app name', renameAppOptionsSchema.shape, async (options: RenameAppOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.RENAME_APP) .addFlags({ app: options.app }) .addPositionalArguments({ newName: options.newName }) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); } ); };
- src/index.ts:53-53 (registration)Invocation of the registerRenameAppTool function during server initialization to add the tool to the MCP server.apps.registerRenameAppTool(server, herokuRepl);
- src/utils/tool-commands.ts:9-9 (helper)Constant mapping the RENAME_APP key to the Heroku CLI command 'apps:rename', used by the CommandBuilder in the handler.RENAME_APP: 'apps:rename',