{"record":{"id":"2099224689e6f77b","repo":"googleapis/mcp-toolbox","slug":"failed-to-list-subcollections-of-document-q-w","errorCode":null,"errorMessage":"failed to list subcollections of document %q: %w","messagePattern":"failed to list subcollections of document %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/firestore/firestore.go","lineNumber":430,"sourceCode":"\t\t\tdocData[\"error\"] = err.Error()\n\t\t} else {\n\t\t\tdocData[\"success\"] = true\n\t\t}\n\n\t\tresults[i] = docData\n\t}\n\treturn results, nil\n}\n\nfunc (s *Source) ListCollections(ctx context.Context, parentPath string) ([]any, error) {\n\tvar collectionRefs []*firestore.CollectionRef\n\tvar err error\n\tif parentPath != \"\" {\n\t\t// List subcollections of the specified document\n\t\tdocRef := s.FirestoreClient().Doc(parentPath)\n\t\tcollectionRefs, err = docRef.Collections(ctx).GetAll()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to list subcollections of document %q: %w\", parentPath, err)\n\t\t}\n\t} else {\n\t\t// List root collections\n\t\tcollectionRefs, err = s.FirestoreClient().Collections(ctx).GetAll()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to list root collections: %w\", err)\n\t\t}\n\t}\n\n\t// Convert collection references to response data\n\tresults := make([]any, len(collectionRefs))\n\tfor i, collRef := range collectionRefs {\n\t\tcollData := make(map[string]any)\n\t\tcollData[\"id\"] = collRef.ID\n\t\tcollData[\"path\"] = collRef.Path\n\n\t\t// If this is a subcollection, include parent information\n\t\tif collRef.Parent != nil {","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/firestore/firestore.go#L412-L448","documentation":"Error \"failed to list subcollections of document %q: %w\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/firestore/firestore.go:430 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}