Skip to main content
Glama
heroku

Heroku MCP server

Official
by heroku

get_app_logs

Retrieve and filter application logs in real-time to monitor activity, debug issues, and analyze performance by dyno, process type, or source on Heroku MCP server applications.

Instructions

View application logs with flexible filtering options. Use this tool when you need to: 1) Monitor application activity in real-time, 2) Debug issues by viewing recent logs, 3) Filter logs by dyno, process type, or source.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appYesSpecifies the target Heroku app whose logs to retrieve. Requirements and behaviors: 1) App must exist and be accessible to you with appropriate permissions, 2) The response includes both system events and application output, 3) Currently it's only available to Cedar generation apps.
dynoNameNoFilter logs by specific dyno instance. Important behaviors: 1) Format is "process_type.instance_number" (e.g., "web.1", "worker.2"). 2) You cannot specify both dynoName and processType parameters together. Best practice: Use when debugging specific dyno behavior or performance issues.
processTypeNoFilter logs by process type. Key characteristics: 1) Common values: "web" (web dynos), "worker" (background workers), 2) Shows logs from all instances of the specified process type, 3) You cannot specify both dynoName and processType parameters together. Best practice: Use when debugging issues specific to web or worker processes.
sourceNoFilter logs by their origin. Key characteristics: 1) Common values: "app" (application logs), "heroku" (platform events), 2) When omitted, shows logs from all sources. Best practice: Use "app" for application debugging, "heroku" for platform troubleshooting.

Implementation Reference

  • The async handler function that builds the Heroku logs command using CommandBuilder, executes it via herokuRepl, and processes the output with handleCliOutput.
    async (options: GetAppLogsOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.LOGS) .addFlags({ app: options.app, 'dyno-name': options.dynoName, source: options.source, 'process-type': options.processType }) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); }
  • Zod schema defining the input parameters for the get_app_logs tool: app (required), optional dynoName, source, processType.
    export const getAppGetAppLogsOptionsSchema = z.object({ app: z.string().describe('Heroku app name. Requires: permissions, Cedar-gen'), dynoName: z.string().optional().describe('Format: web.1/worker.2. Excludes processType'), source: z.string().optional().describe('app=application, heroku=platform. Default: all'), processType: z.string().optional().describe('web|worker. All instances. Excludes dynoName') });
  • The registerGetAppLogsTool function that registers the 'get_app_logs' tool on the MCP server with name, description, schema, and handler.
    export const registerGetAppLogsTool = (server: McpServer, herokuRepl: HerokuREPL): void => { server.tool( 'get_app_logs', 'App logs: monitor/debug/filter by dyno/process/source', getAppGetAppLogsOptionsSchema.shape, async (options: GetAppLogsOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.LOGS) .addFlags({ app: options.app, 'dyno-name': options.dynoName, source: options.source, 'process-type': options.processType }) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); } ); };
  • src/index.ts:60-60 (registration)
    Top-level call to register the get_app_logs tool during server initialization.
    logs.registerGetAppLogsTool(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