{"record":{"id":"f19a62e85dba58a9","repo":"googleapis/mcp-toolbox","slug":"invalid-entry-format-must-be-in-the-form-projects","errorCode":null,"errorMessage":"invalid entry format: must be in the form projects/{project}/locations/{location}/entryGroups/{entryGroup}/entries/{entry}","messagePattern":"invalid entry format: must be in the form projects/(.+?)/locations/(.+?)/entryGroups/(.+?)/entries/(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/dataplex/dataplexlookupentry/dataplexlookupentry.go","lineNumber":134,"sourceCode":"\t}\n\treturn nil\n}\n\nfunc (t Tool) Invoke(ctx context.Context, s sources.Source, params parameters.ParamValues, accessToken tools.AccessToken) (any, util.ToolboxError) {\n\tsource, ok := s.(compatibleSource)\n\tif !ok {\n\t\treturn nil, util.NewClientServerError(\"source used is not compatible with the tool\", http.StatusInternalServerError, nil)\n\t}\n\tparamsMap := params.AsMap()\n\tentry, _ := paramsMap[\"entry\"].(string)\n\tview, _ := paramsMap[\"view\"].(int)\n\taspectTypeSlice, err := parameters.ConvertAnySliceToTyped(paramsMap[\"aspectTypes\"].([]any), \"string\")\n\tif err != nil {\n\t\treturn nil, util.NewAgentError(fmt.Sprintf(\"can't convert aspectTypes to array of strings: %s\", err), err)\n\t}\n\tparts := strings.Split(entry, \"/\")\n\tif len(parts) < 4 || parts[0] != \"projects\" || parts[2] != \"locations\" {\n\t\terr = fmt.Errorf(\"invalid entry format: must be in the form projects/{project}/locations/{location}/entryGroups/{entryGroup}/entries/{entry}\")\n\t\treturn nil, util.NewAgentError(err.Error(), err)\n\t}\n\tname := strings.Join(parts[:4], \"/\")\n\taspectTypes := aspectTypeSlice.([]string)\n\tresp, err := source.LookupEntry(ctx, name, view, aspectTypes, entry)\n\tif err != nil {\n\t\treturn nil, util.ProcessGcpError(err)\n\t}\n\treturn resp, nil\n}\n","sourceCodeStart":116,"sourceCodeEnd":145,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/dataplex/dataplexlookupentry/dataplexlookupentry.go#L116-L145","documentation":"dataplex-lookup-entry's `entry` parameter must be a fully-qualified Dataplex entry name. Invoke splits it on '/' and requires at least 4 segments with 'projects' at index 0 and 'locations' at index 2, since the tool derives the parent name by joining the first 4 segments. Otherwise it returns this AgentError.","triggerScenarios":"entry is a bare id ('my-entry'), a partial path ('projects/p/entryGroups/g/entries/e' missing locations), or a malformed string.","commonSituations":"Agent passes the entry id from search output instead of the full resource name; user supplies a dataset/table name; path built with 'regions' instead of 'locations'.","solutions":["Pass the full name: projects/{project}/locations/{location}/entryGroups/{entryGroup}/entries/{entry}","Use the exact `name` field from dataplex-search-entries results","Verify the path contains 'projects' and 'locations' segments in positions 1 and 3"],"exampleFix":"// before\n{\"entry\": \"projects/p/entryGroups/g/entries/e\"}\n// after\n{\"entry\": \"projects/p/locations/us-central1/entryGroups/g/entries/e\"}","handlingStrategy":"validation","validationCode":"func validEntry(s string) bool {\n\tparts := strings.Split(s, \"/\")\n\treturn len(parts) >= 4 && parts[0] == \"projects\" && parts[2] == \"locations\"\n}\nif !validEntry(entry) {\n\treturn fmt.Errorf(\"entry must be projects/{project}/locations/{location}/entryGroups/{entryGroup}/entries/{entry}\")\n}","typeGuard":"func isFullyQualifiedEntry(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 entry format\") {\n\t// resolve the full name via dataplex-search-entries, then retry\n}","preventionTips":["Pass the full entry resource name, not the id","Use the 'name' field from dataplex-search-entries output directly","Check the path has projects/.../locations/... as the first four segments"],"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"}