{"record":{"id":"e09f549851133499","repo":"googleapis/mcp-toolbox","slug":"no-prebuilt-tool-configurations-were-loaded-w","errorCode":null,"errorMessage":"no prebuilt tool configurations were loaded.%w","messagePattern":"no prebuilt tool configurations were loaded\\.%w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/prebuiltconfigs/prebuiltconfigs.go","lineNumber":87,"sourceCode":"\t}\n\n\tfor _, entry := range entries {\n\t\tlowerName := strings.ToLower(entry.Name())\n\t\tif !entry.IsDir() && (strings.HasSuffix(lowerName, \".yaml\")) {\n\t\t\tfilePathInFS := path.Join(\"tools\", entry.Name())\n\t\t\tcontent, err := prebuiltConfigsFS.ReadFile(filePathInFS)\n\t\t\tif err != nil {\n\t\t\t\terrMsg := fmt.Errorf(\"failed to read a prebuilt tool %w\", err)\n\t\t\t\treturn nil, nil, errMsg\n\t\t\t}\n\t\t\tsourceTypeKey := entry.Name()[:len(entry.Name())-len(\".yaml\")]\n\n\t\t\tsourceTypes = append(sourceTypes, sourceTypeKey)\n\t\t\ttoolYAMLs[sourceTypeKey] = content\n\t\t}\n\t}\n\tif len(toolYAMLs) == 0 {\n\t\terrMsg := fmt.Errorf(\"no prebuilt tool configurations were loaded.%w\", err)\n\t\treturn nil, nil, errMsg\n\t}\n\n\treturn toolYAMLs, sourceTypes, nil\n}\n","sourceCodeStart":69,"sourceCodeEnd":93,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/prebuiltconfigs/prebuiltconfigs.go#L69-L93","documentation":"loadPrebuiltToolYAMLs returns this error when it successfully read the directory but zero .yaml prebuilt configs were registered, leaving the toolYAMLs map empty. (Note: the wrapped %w error is nil here, so the message ends with \"%!w(<nil>)\".) The binary effectively has no prebuilt configs available.","triggerScenarios":"The embedded tools directory exists but contains no files with a .yaml extension (e.g. all renamed to .yml, files deleted, or the glob in the embed directive excludes them).","commonSituations":"A cleanup PR renamed YAML files to .yml; CI builds from a stripped repo; someone moved YAMLs to a subdirectory so ReadDir's non-recursive listing sees none.","solutions":["Confirm internal/prebuiltconfigs/tools/ contains at least one *.yaml file (extension must be exactly .yaml, not .yml).","Check the //go:embed pattern in prebuiltconfigs.go includes tools/*.yaml.","Rebuild the binary after restoring the YAML files.","Fix the err arg: pass nil-safe text — the current fmt.Errorf(\"...%w\", err) with nil err prints %!w(<nil>) and masks that there is no underlying cause."],"exampleFix":"// before\nif !entry.IsDir() && strings.HasSuffix(lowerName, \".yaml\") {\n// after (if files are .yml)\nif !entry.IsDir() && (strings.HasSuffix(lowerName, \".yaml\") || strings.HasSuffix(lowerName, \".yml\")) {","handlingStrategy":"validation","validationCode":"// CI check: at least one prebuilt YAML exists\nyamlFiles, err := filepath.Glob(\"internal/prebuiltconfigs/tools/*.yaml\")\nif err != nil || len(yamlFiles) == 0 {\n\tlog.Fatal(\"no prebuilt *.yaml configs found in internal/prebuiltconfigs/tools/\")\n}","typeGuard":null,"tryCatchPattern":"toolYAMLs, sources, err := loadPrebuiltToolYAMLs()\nif err != nil {\n\tif strings.Contains(err.Error(), \"no prebuilt tool configurations were loaded\") {\n\t\tlog.Fatal(\"build error: embedded tools dir has no *.yaml files\")\n\t}\n\treturn err\n}","preventionTips":["Use the .yaml extension exactly (not .yml) for prebuilt configs.","Keep YAMLs flat in tools/ — ReadDir is not recursive.","Add a unit test asserting len(toolYAMLs) > 0 after init.","Fix the wrap: don't pass nil err to %w (currently prints %!w(<nil>))."],"tags":["prebuilt-configs","embed","configuration"],"backgroundTag":"no-configs-loaded","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"}