{"record":{"id":"6813ed6b075ac06e","repo":"googleapis/mcp-toolbox","slug":"failed-to-list-root-collections-w","errorCode":null,"errorMessage":"failed to list root collections: %w","messagePattern":"failed to list root collections: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/firestore/firestore.go","lineNumber":436,"sourceCode":"\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 {\n\t\t\tcollData[\"parent\"] = collRef.Parent.Path\n\t\t}\n\t\tresults[i] = collData\n\t}\n\treturn results, nil\n}","sourceCodeStart":418,"sourceCodeEnd":454,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/firestore/firestore.go#L418-L454","documentation":"Error \"failed to list root collections: %w\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/firestore/firestore.go:436 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"}