list_documents
Retrieve documents from a Firestore collection in the Firebase Emulator. Specify a collection path and optional limit to view stored data.
Instructions
List documents in a collection with optional limit
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collectionPath | Yes | Collection path (e.g., 'users' or 'users/user123/orders') | |
| limit | No | Max documents to return (default: 20) |
Implementation Reference
- src/index.ts:256-259 (handler)The handler function that executes the logic to list documents from a Firebase collection.
async function handleListDocuments(collectionPath: string, limit = 20) { const snapshot = await db.collection(collectionPath).limit(limit).get(); return snapshot.docs.map(docToObject); } - src/index.ts:401-402 (registration)Registration of the "list_documents" tool within the MCP CallToolRequestSchema handler switch case.
case "list_documents": result = await handleListDocuments(args?.collectionPath as string, args?.limit as number);