{"record":{"id":"af67d25634cb77f2","repo":"googleapis/mcp-toolbox","slug":"manual-prm-file-does-not-match-expected-schema-w","errorCode":null,"errorMessage":"manual PRM file does not match expected schema: %w","messagePattern":"manual PRM file does not match expected schema: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/server/server.go","lineNumber":565,"sourceCode":"\tfor _, authSvc := range s.PrimitiveMgr.AuthServices() {\n\t\tif mSvc, ok := authSvc.(auth.MCPAuthService); ok && mSvc.IsMCPEnabled() {\n\t\t\tmcpAuthEnabled = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// Manual PRM override\n\tvar cachedPrmBytes []byte\n\tvar prmConfig ProtectedResourceMetadata\n\tif s.mcpPrmFile != \"\" {\n\t\tvar err error\n\t\tcachedPrmBytes, err = os.ReadFile(s.mcpPrmFile)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to read manual PRM file at startup: %w\", err)\n\t\t}\n\t\t// Unmarshal into the struct to strictly validate the schema\n\t\tif err := json.Unmarshal(cachedPrmBytes, &prmConfig); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"manual PRM file does not match expected schema: %w\", err)\n\t\t}\n\t}\n\n\t// Register route if auth is enabled or a manual file is provided\n\tif mcpAuthEnabled || s.mcpPrmFile != \"\" {\n\t\tr.Get(prmURL.Path, func(w http.ResponseWriter, req *http.Request) {\n\t\t\t// Serve from memory if file was loaded\n\t\t\tif s.mcpPrmFile != \"\" {\n\t\t\t\tw.Header().Set(\"Content-Type\", \"application/json\")\n\t\t\t\tw.WriteHeader(http.StatusOK)\n\t\t\t\tif _, err := w.Write(cachedPrmBytes); err != nil {\n\t\t\t\t\ts.logger.ErrorContext(req.Context(), \"failed to write manual PRM file response\", \"error\", err)\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tprmHandler(s, w, req)\n\t\t})","sourceCodeStart":547,"sourceCodeEnd":583,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/server/server.go#L547-L583","documentation":"Error \"manual PRM file does not match expected schema: %w\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/server/server.go:565 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"}