{"record":{"id":"aecb8afa3781f36e","repo":"googleapis/mcp-toolbox","slug":"failed-to-add-delete-operation-for-document-q-w","errorCode":null,"errorMessage":"failed to add delete operation for document %q: %w","messagePattern":"failed to add delete operation for document %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/firestore/firestore.go","lineNumber":394,"sourceCode":"\t\tresponse[\"documentData\"] = simplifiedData\n\t}\n\n\treturn response, nil\n}\n\nfunc (s *Source) DeleteDocuments(ctx context.Context, documentPaths []string) ([]any, error) {\n\t// Create a BulkWriter to handle multiple deletions efficiently\n\tbulkWriter := s.FirestoreClient().BulkWriter(ctx)\n\n\t// Keep track of jobs for each document\n\tjobs := make([]*firestore.BulkWriterJob, len(documentPaths))\n\n\t// Add all delete operations to the BulkWriter\n\tfor i, path := range documentPaths {\n\t\tdocRef := s.FirestoreClient().Doc(path)\n\t\tjob, err := bulkWriter.Delete(docRef)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to add delete operation for document %q: %w\", path, err)\n\t\t}\n\t\tjobs[i] = job\n\t}\n\n\t// End the BulkWriter to execute all operations\n\tbulkWriter.End()\n\n\t// Collect results\n\tresults := make([]any, len(documentPaths))\n\tfor i, job := range jobs {\n\t\tdocData := make(map[string]any)\n\t\tdocData[\"path\"] = documentPaths[i]\n\n\t\t// Wait for the job to complete and get the result\n\t\t_, err := job.Results()\n\t\tif err != nil {\n\t\t\tdocData[\"success\"] = false\n\t\t\tdocData[\"error\"] = err.Error()","sourceCodeStart":376,"sourceCodeEnd":412,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/firestore/firestore.go#L376-L412","documentation":"Error \"failed to add delete operation for document %q: %w\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/firestore/firestore.go:394 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"}