{"record":{"id":"1f6e8f4afd4c4886","repo":"googleapis/mcp-toolbox","slug":"invalid-resource-format-at-index-d-must-be-in-th","errorCode":null,"errorMessage":"invalid resource format at index %d, must be in the format of projects/{project_id_or_number}/locations/{location}/entryGroups/{group}/entries/{entry}","messagePattern":"invalid resource format at index (.+?), must be in the format of projects/(.+?)/locations/(.+?)/entryGroups/(.+?)/entries/(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/dataplex/dataplexlookupcontext/dataplexlookupcontext.go","lineNumber":130,"sourceCode":"\t\treturn nil, util.NewClientServerError(\"source used is not compatible with the tool\", http.StatusInternalServerError, nil)\n\t}\n\tparamsMap := params.AsMap()\n\tresourcesSlice, err := parameters.ConvertAnySliceToTyped(paramsMap[\"resources\"].([]any), \"string\")\n\tif err != nil {\n\t\treturn nil, util.NewAgentError(fmt.Sprintf(\"can't convert resources to array of strings: %s\", err), err)\n\t}\n\tresources := resourcesSlice.([]string)\n\n\tif len(resources) == 0 {\n\t\terr := fmt.Errorf(\"resources cannot be empty\")\n\t\treturn nil, util.NewAgentError(err.Error(), err)\n\t}\n\tvar name string\n\tvar firstLocation string\n\tfor i, resource := range resources {\n\t\tparts := strings.Split(resource, \"/\")\n\t\tif len(parts) < 4 || parts[0] != \"projects\" || parts[2] != \"locations\" {\n\t\t\terr := fmt.Errorf(\"invalid resource format at index %d, must be in the format of projects/{project_id_or_number}/locations/{location}/entryGroups/{group}/entries/{entry}\", i)\n\t\t\treturn nil, util.NewAgentError(err.Error(), err)\n\t\t}\n\n\t\tlocation := parts[3]\n\t\tif i == 0 {\n\t\t\tfirstLocation = location\n\t\t\tproject := source.ProjectID()\n\t\t\tname = fmt.Sprintf(\"projects/%s/locations/%s\", project, location)\n\t\t} else if location != firstLocation {\n\t\t\terr := fmt.Errorf(\"all resources must belong to the same location. Please make separate calls for each distinct location\")\n\t\t\treturn nil, util.NewAgentError(err.Error(), err)\n\t\t}\n\t}\n\n\tresp, err := source.LookupContext(ctx, name, resources)\n\tif err != nil {\n\t\treturn nil, util.ProcessGcpError(err)\n\t}","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/dataplex/dataplexlookupcontext/dataplexlookupcontext.go#L112-L148","documentation":"Each resource in dataplex-lookup-context must be a fully-qualified Dataplex entry name starting with projects/{id}/locations/{location}. Invoke splits each resource on '/' and rejects any entry with fewer than 4 segments or whose segments 0 and 2 are not 'projects' and 'locations', reporting the offending index.","triggerScenarios":"resources[i] is a partial name like 'my-entry', 'projects/p/entries/e' (missing locations), a table/asset id, or a URL-encoded/wrongly-formatted path.","commonSituations":"Agent constructs entry names from truncated search results; user pastes only the entry id; region vs location segment confusion (e.g. 'regions/' instead of 'locations/').","solutions":["Pass the full resource name: projects/{project_id_or_number}/locations/{location}/entryGroups/{group}/entries/{entry}","Use the exact resource name returned by dataplex-search-entries or dataplex-lookup-entry","Check that segments are 'projects' and 'locations' (not 'region' or 'buckets') in order"],"exampleFix":"// before\n{\"resources\": [\"my-entry\"]}\n// after\n{\"resources\": [\"projects/my-proj/locations/us-central1/entryGroups/my-group/entries/my-entry\"]}","handlingStrategy":"validation","validationCode":"func validEntryName(r string) bool {\n\tparts := strings.Split(r, \"/\")\n\treturn len(parts) >= 4 && parts[0] == \"projects\" && parts[2] == \"locations\"\n}\nfor i, r := range resources {\n\tif !validEntryName(r) {\n\t\treturn fmt.Errorf(\"resources[%d] is not a fully-qualified entry name\", i)\n\t}\n}","typeGuard":"func isFullyQualifiedEntryName(s string) bool {\n\tparts := strings.Split(s, \"/\")\n\treturn len(parts) >= 4 && parts[0] == \"projects\" && parts[2] == \"locations\"\n}","tryCatchPattern":"_, terr := tool.Invoke(ctx, src, params, token)\nif terr != nil && strings.Contains(terr.Error(), \"invalid resource format\") {\n\t// re-resolve entry names via dataplex-search-entries, then retry\n}","preventionTips":["Only pass resource names copied verbatim from search/lookup results","Never pass bare entry ids or dataset names","Ensure 'locations' (not 'regions') appears as the third path segment"],"tags":["go","dataplex","validation","resource-name-format"],"backgroundTag":"invalid-resource-name-format","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"}