{"record":{"id":"4874299e3e35293b","repo":"googleapis/mcp-toolbox","slug":"s-is-not-a-valid-type-of-auth-service","errorCode":null,"errorMessage":"%s is not a valid type of auth service","messagePattern":"(.+?) is not a valid type of auth service","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/server/config.go","lineNumber":433,"sourceCode":"\t\t\treturn nil, fmt.Errorf(\"unable to parse as %s: %w\", name, err)\n\t\t}\n\t\tif !actual.McpEnabled {\n\t\t\tif actual.IntrospectionEndpoint != \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"`introspectionEndpoint` is not allowed when `mcpEnabled` is false\")\n\t\t\t}\n\t\t\tif actual.IntrospectionMethod != \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"`introspectionMethod` is not allowed when `mcpEnabled` is false\")\n\t\t\t}\n\t\t\tif actual.IntrospectionParamName != \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"`introspectionParamName` is not allowed when `mcpEnabled` is false\")\n\t\t\t}\n\t\t\tif len(actual.ScopesRequired) > 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"`scopesRequired` is not allowed when `mcpEnabled` is false\")\n\t\t\t}\n\t\t}\n\t\treturn actual, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"%s is not a valid type of auth service\", resourceType)\n\t}\n}\n\nfunc UnmarshalYAMLEmbeddingModelConfig(ctx context.Context, name string, r map[string]any) (embeddingmodels.EmbeddingModelConfig, error) {\n\tresourceType, ok := r[\"type\"].(string)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"missing 'type' field or it is not a string\")\n\t}\n\tif resourceType != gemini.EmbeddingModelType {\n\t\treturn nil, fmt.Errorf(\"%s is not a valid type of embedding model\", resourceType)\n\t}\n\tdec, err := util.NewStrictDecoder(r)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating decoder: %s\", err)\n\t}\n\tactual := gemini.Config{Name: name}\n\tif err := dec.DecodeContext(ctx, &actual); err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to parse as %q: %w\", name, err)","sourceCodeStart":415,"sourceCodeEnd":451,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/server/config.go#L415-L451","documentation":"During YAML config parsing, an authServices entry had a `type` value that is not one of the supported auth service kinds (`google` or `generic`). UnmarshalYAMLAuthServiceConfig switches on the `type` string and the default branch rejects anything unrecognized. This is a config-level validation error thrown before any server startup work.","triggerScenarios":"Calling UnmarshalPrimitiveConfig (via server startup from a tools.yaml) with an authServices entry whose `type` field is a string other than \"google\" or \"generic\" (e.g. \"google_oauth\", \"oidc\", a typo like \"Googel\", or a copy-paste from another product).","commonSituations":"Typo in the type name; copying an auth config from another MCP framework that supports more auth types; older configs using a type name that was renamed or removed; hand-writing YAML instead of using documented examples.","solutions":["Change the auth service `type` to a supported value: `google` or `generic`","Check the config docs for the exact supported auth service type strings and their required fields","If the intent was no auth service, remove the authServices entry entirely"],"exampleFix":"// before\nauthServices:\n  my-google:\n    type: google-oauth\n    clientId: ... \n// after\nauthServices:\n  my-google:\n    type: google\n    clientId: ...","handlingStrategy":"validation","validationCode":"const validAuthTypes = []string{\"google\", \"generic\"}\nfunc validateAuthService(cfg map[string]any) error {\n  t, ok := cfg[\"type\"].(string)\n  if !ok { return fmt.Errorf(\"auth service missing string 'type'\") }\n  for _, v := range validAuthTypes { if t == v { return nil } }\n  return fmt.Errorf(\"unsupported auth service type %q\", t)\n}","typeGuard":"func isAuthServiceType(v any) bool {\n  s, ok := v.(string)\n  return ok && (s == \"google\" || s == \"generic\")\n}","tryCatchPattern":null,"preventionTips":["Copy auth service blocks from the official docs, not other frameworks","Keep a list of supported auth service types pinned to your toolbox version","Lint tools.yaml in CI before deploy"],"tags":["config","yaml","auth","validation"],"backgroundTag":"invalid-config-type","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"}