list_functions
View all Cloud Functions registered in the Firebase Emulator to monitor and manage serverless operations during development.
Instructions
List all Cloud Functions registered in the emulator
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_functions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:349-375 (handler)The handleListFunctions function implementation which fetches functions from the Firebase emulator or falls back to log analysis.
async function handleListFunctions() { try { const response = await fetch(`http://${FIREBASE_EMULATOR_HUB}/emulators`); if (!response.ok) return []; const data = await response.json(); const functionsEmulator = data.functions; if (!functionsEmulator) return []; // Try to get function list from emulator const functionsUrl = `http://${functionsEmulator.host || 'localhost'}:${functionsEmulator.port}/__/functions/list`; const fnResponse = await fetch(functionsUrl); if (fnResponse.ok) { const fnData = await fnResponse.json(); return (fnData.functions || []).map((fn: any) => ({ name: fn.name || fn.id, trigger: fn.trigger?.httpsTrigger ? "https" : fn.trigger?.eventTrigger?.eventType || "unknown", region: fn.region || "us-central1", })); } // Fallback: extract unique function names from logs const uniqueFunctions = [...new Set(logBuffer.map(l => l.function).filter(Boolean))]; return uniqueFunctions.map(name => ({ name, trigger: "unknown", region: "unknown" })); } catch { return []; } } - src/index.ts:214-217 (registration)Registration of the list_functions tool in the tools array.
name: "list_functions", description: "List all Cloud Functions registered in the emulator", inputSchema: { type: "object" as const, properties: {} }, }, - src/index.ts:419-421 (handler)Tool request handler for list_functions.
case "list_functions": result = await handleListFunctions(); break;