list_subcollections
Retrieve subcollections from a Firestore document path to navigate database structure in Firebase Emulator environments.
Instructions
List subcollections of a document
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| documentPath | Yes | Full document path (e.g., 'users/user123') |
Implementation Reference
- src/index.ts:250-254 (handler)Handler implementation for list_subcollections.
async function handleListSubcollections(documentPath: string) { const docRef = db.doc(documentPath); const collections = await docRef.listCollections(); return collections.map((col) => col.id); } - src/index.ts:153-162 (schema)Schema registration and definition for list_subcollections.
name: "list_subcollections", description: "List subcollections of a document", inputSchema: { type: "object" as const, properties: { documentPath: { type: "string", description: "Full document path (e.g., 'users/user123')" }, }, required: ["documentPath"], }, },