{"record":{"id":"0a1fefa89a8ffbb7","repo":"googleapis/mcp-toolbox","slug":"store-id-s-is-not-in-the-list-of-allowed-stores","errorCode":null,"errorMessage":"store ID '%s' is not in the list of allowed stores","messagePattern":"store ID '(.+?)' is not in the list of allowed stores","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/cloudhealthcare/common/util.go","lineNumber":53,"sourceCode":"const IncludeAttributesKey = \"includefield\"\n\n// ValidateAndFetchStoreID validates the provided storeID against the allowedStores.\n// If only one store is allowed, it returns that storeID.\n// If multiple stores are allowed, it checks if the storeID parameter is in the allowed list.\nfunc ValidateAndFetchStoreID(params parameters.ParamValues, allowedStores map[string]struct{}) (string, error) {\n\tif len(allowedStores) == 1 {\n\t\tfor k := range allowedStores {\n\t\t\treturn k, nil\n\t\t}\n\t}\n\tmapParams := params.AsMap()\n\tstoreID, ok := mapParams[StoreKey].(string)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"invalid or missing '%s' parameter; expected a string\", StoreKey)\n\t}\n\tif len(allowedStores) > 0 {\n\t\tif _, ok := allowedStores[storeID]; !ok {\n\t\t\treturn \"\", fmt.Errorf(\"store ID '%s' is not in the list of allowed stores\", storeID)\n\t\t}\n\t}\n\treturn storeID, nil\n}\n\n// ParseDICOMSearchParameters extracts the search parameters for various DICOM\n// search methods.\nfunc ParseDICOMSearchParameters(params parameters.ParamValues, paramKeys []string) ([]googleapi.CallOption, error) {\n\tvar opts []googleapi.CallOption\n\tfor k, v := range params.AsMap() {\n\t\tif k == IncludeAttributesKey {\n\t\t\tif _, ok := v.([]any); !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid '%s' parameter; expected a string array\", k)\n\t\t\t}\n\t\t\tattributeIDsSlice, err := parameters.ConvertAnySliceToTyped(v.([]any), \"string\")\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"can't convert '%s' to array of strings: %s\", k, err)\n\t\t\t}","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudhealthcare/common/util.go#L35-L71","documentation":"After reading the `storeID` string parameter, ValidateAndFetchStoreID checks it against the allowedStores set configured on the source. If the source declares an allowlist and the supplied store ID is not in it, this error is returned to prevent accessing stores outside the configured scope.","triggerScenarios":"Invoking a healthcare tool with a storeID string that is valid but not present in the source's `allowedStores`/`allowedFHIRStores`/`allowedDICOMStores` configuration list.","commonSituations":"Typo in the store name (case-sensitive mismatch); store renamed in Google Cloud but config allowlist not updated; using a store from a different project/dataset than the source is configured for.","solutions":["Use a store ID exactly matching one of the entries in the source's allowedStores config.","Update the source's `allowedStores` list in the YAML to include the desired store.","Verify spelling/case of the store ID against `gcloud healthcare dicom-stores list`.","Omit/empty the allowlist if any store under the dataset should be permitted."],"exampleFix":"// before (config)\nsource:\n  kind: cloudhealthcare\n  allowedDICOMStores: [store-a]\n// invocation: storeID: store-b  -> rejected\n// after\nsource:\n  kind: cloudhealthcare\n  allowedDICOMStores: [store-a, store-b]","handlingStrategy":"validation","validationCode":"const allowed = new Set([\"store-a\", \"store-b\"]); // mirror of source allowedStores\nif (!allowed.has(params.storeID)) {\n  throw new Error(`storeID ${params.storeID} not in allowed list`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy store IDs from `gcloud healthcare dicom-stores list` to avoid typos","Update the source allowlist whenever stores are added/renamed in GCP","Keep allowlist comparisons case-sensitive and exact","Regenerate configs from a source of truth for store names"],"tags":["go","authorization-scope","cloud-healthcare","allowlist"],"backgroundTag":"resource-not-allowed","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"}