Skip to main content
Glama
NigelThorne

Firebase MCP Server

by NigelThorne

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

TableJSON Schema
NameRequiredDescriptionDefault
documentPathYesFull document path (e.g., 'users/user123')

Implementation Reference

  • 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);
    }
  • 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"],
      },
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full disclosure burden. It fails to describe return format (array of strings? objects?), pagination behavior, error handling (what if documentPath is invalid?), or side effects. For a query tool with zero safety annotations, this is inadequate behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Extremely brief at 5 words. While efficient, given the lack of annotations and output schema, this brevity sacrifices necessary behavioral context. Structure is front-loaded but underspecified for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Missing critical context: return value structure, error scenarios, and distinction from similar list operations. With no output schema and no annotations, the description should compensate by explaining what subcollection metadata is returned.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 100% description coverage with clear example ('users/user123'). The description adds no additional parameter guidance beyond what the schema already provides, meeting the baseline for high-coverage schemas.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description uses specific verb 'List' with clear resource 'subcollections of a document'. It distinguishes reasonably from siblings: list_collections (top-level) and list_documents (documents vs subcollections). However, it doesn't clarify the hierarchical relationship (subcollections are nested under documents) which would further differentiate it.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this versus list_collections or query_collection. No mention of prerequisites (document must exist?) or error conditions. The usage must be inferred entirely from the parameter name 'documentPath'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/NigelThorne/firebase_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server