{"record":{"id":"772309c32b35092e","repo":"googleapis/mcp-toolbox","slug":"invalid-toolbox-url-q-w","errorCode":null,"errorMessage":"invalid toolbox-url %q: %w","messagePattern":"invalid toolbox-url %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/server/prm.go","lineNumber":89,"sourceCode":"\n\t// OPTIONAL. A JWT containing metadata parameters about the protected resource\n\t// as claims. Consists of the entire signed JWT string.\n\tSignedMetadata string `json:\"signed_metadata,omitempty\"`\n}\n\n// getPRMURL returns the full URL to advertise in WWW-Authenticate headers.\nfunc (s *Server) getPRMURL() string {\n\treturn s.prmURL\n}\n\n// parsePRMURL returns the full URL to advertise in WWW-Authenticate headers from a toolbox URL.\nfunc parsePRMURL(toolboxUrl string) (string, error) {\n\tif toolboxUrl == \"\" {\n\t\treturn \"/.well-known/oauth-protected-resource\", nil\n\t}\n\tu, err := url.Parse(toolboxUrl)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"invalid toolbox-url %q: %w\", toolboxUrl, err)\n\t}\n\tif u.Scheme != \"\" || u.Host != \"\" {\n\t\tif u.Scheme == \"\" || u.Host == \"\" {\n\t\t\treturn \"\", fmt.Errorf(\"invalid toolbox-url %q: must be a valid absolute URL with scheme and host\", toolboxUrl)\n\t\t}\n\t\tpath := strings.TrimSuffix(u.Path, \"/\")\n\t\treturn u.Scheme + \"://\" + u.Host + \"/.well-known/oauth-protected-resource\" + path, nil\n\t}\n\tpath := strings.TrimSuffix(u.Path, \"/\")\n\tif !strings.HasPrefix(path, \"/\") {\n\t\tpath = \"/\" + path\n\t}\n\tif path == \"/\" {\n\t\treturn \"/.well-known/oauth-protected-resource\", nil\n\t}\n\treturn \"/.well-known/oauth-protected-resource\" + path, nil\n}\n","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/server/prm.go#L71-L107","documentation":"Error \"invalid toolbox-url %q: %w\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/server/prm.go:89 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"}