Skip to main content
Glama
heroku

Heroku MCP server

Official
by heroku

pg_info

Analyze Heroku PostgreSQL database configurations, monitor performance metrics, and assess health and resource usage. Obtain detailed insights into database operations for informed decision-making.

Instructions

Display detailed information about Heroku PostgreSQL databases. Use this tool when you need to: 1) View comprehensive database configuration and status, 2) Monitor database performance metrics, 3) Check connection and resource utilization, 4) Assess database health and capacity. The tool provides detailed insights into database operations and configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appYesThe name of the Heroku app whose database to inspect.
databaseNoConfig var containing the connection string, unique name, ID, or alias of the database. To access another app's database, prepend the app name to the config var or alias with `APP_NAME::`. If omitted, all databases are shown.

Implementation Reference

  • The handler function that constructs and executes the 'heroku pg:info' CLI command based on input options, processes the output using handleCliOutput.
    async (options: PgInfoOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.PG_INFO) .addFlags({ app: options.app }) .addPositionalArguments({ database: options.database }) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); }
  • Zod schema defining the input parameters for the pg_info tool: required app name and optional database identifier.
    export const pgInfoOptionsSchema = z.object({ app: z.string().describe('Target app name'), database: z .string() .optional() .describe('Database identifier. Format: APP_NAME::DB for other apps. Default: all databases') }); export type PgInfoOptions = z.infer<typeof pgInfoOptionsSchema>;
  • Function that registers the 'pg_info' tool on the MCP server with name, description, input schema, and handler implementation.
    export const registerPgInfoTool = (server: McpServer, herokuRepl: HerokuREPL): void => { server.tool( 'pg_info', 'View database status: config, metrics, resources, health', pgInfoOptionsSchema.shape, async (options: PgInfoOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.PG_INFO) .addFlags({ app: options.app }) .addPositionalArguments({ database: options.database }) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); } ); };
  • Constant mapping TOOL_COMMAND_MAP.PG_INFO to the Heroku CLI command 'pg:info' used by the handler.
    PG_INFO: 'pg:info',
  • src/index.ts:77-77 (registration)
    Invocation of the registerPgInfoTool during MCP server initialization to enable the tool.
    data.registerPgInfoTool(server, herokuRepl);

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