{"record":{"id":"e276f33ed2381763","repo":"googleapis/mcp-toolbox","slug":"failed-to-list-collections-w","errorCode":null,"errorMessage":"failed to list collections: %w","messagePattern":"failed to list collections: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/firestore/firestore.go","lineNumber":624,"sourceCode":"\tTypes []string `json:\"types\"`\n}\n\n// CollectionSchema represents metadata for a Firestore collection\ntype CollectionSchema struct {\n\tCollection string        `json:\"collection\"`\n\tFields     []FieldSchema `json:\"fields\"`\n}\n\n// GetSchema returns schema information for the specified collection or all root collections.\nfunc (s *Source) GetSchema(ctx context.Context, collection string) (any, error) {\n\tvar collectionsToInspect []string\n\tif collection != \"\" {\n\t\tcollectionsToInspect = []string{collection}\n\t} else {\n\t\t// Discover root collections\n\t\tcollRefs, err := s.FirestoreClient().Collections(ctx).GetAll()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to list collections: %w\", err)\n\t\t}\n\t\tfor _, ref := range collRefs {\n\t\t\tcollectionsToInspect = append(collectionsToInspect, ref.ID)\n\t\t}\n\t}\n\n\tresult := make([]CollectionSchema, 0, len(collectionsToInspect))\n\tfor _, collName := range collectionsToInspect {\n\t\tschema, err := s.getSchemaFromPipeline(ctx, collName)\n\t\tif err == nil && len(schema.Fields) > 0 {\n\t\t\tresult = append(result, schema)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Fallback: sample documents directly if get_schema pipeline stage is not available\n\t\tcollRef := s.FirestoreClient().Collection(collName)\n\t\tdocs, err := collRef.Limit(50).Documents(ctx).GetAll()\n\t\tif err != nil {","sourceCodeStart":606,"sourceCodeEnd":642,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/firestore/firestore.go#L606-L642","documentation":"Error \"failed to list collections: %w\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/firestore/firestore.go:624 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"}