modal_logs
Retrieve recent logs from Modal applications to monitor execution and debug issues. Specify the app name and line count to analyze targeted output history.
Instructions
Get recent logs from a Modal app.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_name | Yes | Modal app name (e.g. "remotion-render", "voice-clone") | |
| lines | No | Number of log lines to return (default: 50) |
Implementation Reference
- server.js:269-279 (handler)The handler function that executes the modal_logs tool. It uses execSync to run 'modal app logs <app_name>' CLI command and returns the log output.
async handler({ app_name, lines = 50 }) { try { const out = execSync( `${MODAL_BIN} app logs ${app_name} 2>&1 | head -${lines}`, { timeout: 15000, shell: '/bin/zsh' } ).toString(); return { app_name, logs: out }; } catch (err) { throw new Error(`modal logs failed: ${err.message}`); } }, - server.js:259-280 (registration)The complete tool registration for modal_logs in the TOOLS object. Includes description, inputSchema, and handler function.
modal_logs: { description: 'Get recent logs from a Modal app.', inputSchema: { type: 'object', required: ['app_name'], properties: { app_name: { type: 'string', description: 'Modal app name (e.g. "remotion-render", "voice-clone")' }, lines: { type: 'number', description: 'Number of log lines to return (default: 50)' }, }, }, async handler({ app_name, lines = 50 }) { try { const out = execSync( `${MODAL_BIN} app logs ${app_name} 2>&1 | head -${lines}`, { timeout: 15000, shell: '/bin/zsh' } ).toString(); return { app_name, logs: out }; } catch (err) { throw new Error(`modal logs failed: ${err.message}`); } }, }, - server.js:261-268 (schema)Input schema definition for modal_logs tool. Requires 'app_name' string and accepts optional 'lines' number parameter (default: 50).
inputSchema: { type: 'object', required: ['app_name'], properties: { app_name: { type: 'string', description: 'Modal app name (e.g. "remotion-render", "voice-clone")' }, lines: { type: 'number', description: 'Number of log lines to return (default: 50)' }, }, },