pg_backups
Manage and monitor Heroku app database backups using this tool. View existing backups, track progress, verify availability, and ensure disaster recovery readiness.
Instructions
Manage database backup operations and schedules. Use this tool when you need to: 1) View existing database backups, 2) Monitor backup schedules and status, 3) Track backup operation progress, 4) Verify backup availability. The tool helps maintain database backup operations and disaster recovery readiness.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | Yes | The name of the Heroku app whose backups to manage. |
Implementation Reference
- src/tools/data.ts:373-382 (handler)The handler function for the 'pg_backups' tool. It constructs a CommandBuilder for 'pg:backups' with the app flag and executes it via herokuRepl, returning formatted output.async (options: PgBackupsOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.PG_BACKUPS) .addFlags({ app: options.app }) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); }
- src/tools/data.ts:129-133 (schema)Zod schema defining the input parameters for the pg_backups tool: requires 'app' string.export const pgBackupsOptionsSchema = z.object({ app: z.string().describe('Target app name') }); export type PgBackupsOptions = z.infer<typeof pgBackupsOptionsSchema>;
- src/tools/data.ts:368-384 (registration)The registration function for the pg_backups tool, which calls server.tool with name, description, schema, and inline handler.export const registerPgBackupsTool = (server: McpServer, herokuRepl: HerokuREPL): void => { server.tool( 'pg_backups', 'Manage backups: schedules, status, verification, recovery', pgBackupsOptionsSchema.shape, async (options: PgBackupsOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.PG_BACKUPS) .addFlags({ app: options.app }) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); } ); };
- src/index.ts:84-84 (registration)Invocation of the registerPgBackupsTool during server initialization.data.registerPgBackupsTool(server, herokuRepl);
- src/utils/tool-commands.ts:39-39 (helper)Constant mapping the PG_BACKUPS key to the Heroku CLI command 'pg:backups' used in the handler.PG_BACKUPS: 'pg:backups',