modal_apps
List deployed Modal applications with status, task count, and creation date to monitor cloud infrastructure and application health.
Instructions
List all deployed Modal apps with their status, task count, and creation date.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.js:237-257 (handler)The handler function that executes the modal_apps tool logic. It runs 'modal app list' CLI command, parses the table output, and returns structured app data including app_id, description, state, tasks, and created_at.
async handler() { try { const out = execSync(`${MODAL_BIN} app list 2>&1`, { timeout: 15000 }).toString(); // Parse the table output into structured data const lines = out.split('\n').filter(l => l.includes('│') && !l.includes('App ID') && !l.includes('━')); const apps = lines.map(line => { const cols = line.split('│').map(c => c.trim()).filter(Boolean); return cols.length >= 3 ? { app_id: cols[0], description: cols[1], state: cols[2], tasks: cols[3] || '0', created_at: cols[4] || '', } : null; }).filter(Boolean); return { apps, raw: out }; } catch (err) { throw new Error(`modal app list failed: ${err.message}`); } }, }, - server.js:231-257 (registration)The modal_apps tool definition within the TOOLS object. Contains description, inputSchema (empty object since no inputs required), and the handler function. This is where the tool is registered in the MCP server.
modal_apps: { description: 'List all deployed Modal apps with their status, task count, and creation date.', inputSchema: { type: 'object', properties: {}, }, async handler() { try { const out = execSync(`${MODAL_BIN} app list 2>&1`, { timeout: 15000 }).toString(); // Parse the table output into structured data const lines = out.split('\n').filter(l => l.includes('│') && !l.includes('App ID') && !l.includes('━')); const apps = lines.map(line => { const cols = line.split('│').map(c => c.trim()).filter(Boolean); return cols.length >= 3 ? { app_id: cols[0], description: cols[1], state: cols[2], tasks: cols[3] || '0', created_at: cols[4] || '', } : null; }).filter(Boolean); return { apps, raw: out }; } catch (err) { throw new Error(`modal app list failed: ${err.message}`); } }, }, - server.js:233-236 (schema)The inputSchema for modal_apps tool. Defines an empty object schema since the tool takes no input parameters.
inputSchema: { type: 'object', properties: {}, },