{"record":{"id":"2ab82d927cb685d7","repo":"vercel-labs/agent-browser","slug":"the-goto-action-requires-a-url","errorCode":null,"errorMessage":"The \"goto\" action requires a url.","messagePattern":"The \"goto\" action requires a url\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@agent-browser/eve/extension/tools/navigate.ts","lineNumber":19,"sourceCode":"import { defineTool } from \"eve/tools\";\nimport { z } from \"zod\";\n\nimport { runBrowser } from \"../lib/browser\";\n\nexport default defineTool({\n  description:\n    \"Navigate the sandboxed browser: open a URL, or go back/forward/reload. Launches the browser on first use. After navigating, call the snapshot tool to see the page.\",\n  inputSchema: z.object({\n    action: z\n      .enum([\"goto\", \"back\", \"forward\", \"reload\"])\n      .default(\"goto\")\n      .describe('\"goto\" opens the given URL; the others act on history.'),\n    url: z.string().optional().describe('Required when action is \"goto\".'),\n  }),\n  async execute({ action, url }, ctx) {\n    if (action === \"goto\") {\n      if (url === undefined) {\n        throw new Error('The \"goto\" action requires a url.');\n      }\n      return await runBrowser(ctx, [\"open\", url]);\n    }\n    return await runBrowser(ctx, [action]);\n  },\n});\n","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/vercel-labs/agent-browser/blob/548b159b30eef119ccf6846c8bc807d0eaa3f6f8/packages/@agent-browser/eve/extension/tools/navigate.ts#L1-L26","documentation":"The eve 'navigate' tool maps action 'goto' to 'agent-browser open <url>'. url is optional in the schema only because the other actions (back/forward/reload) take none; execute() throws when action is 'goto' and url is undefined so the CLI never receives a argument-less open.","triggerScenarios":"Invoking navigate with { action: 'goto' } and no url; explicitly passing action: 'goto' while the url lives in an undefined variable; empty-string url is allowed by the schema but only undefined triggers this guard.","commonSituations":"Agents defaulting action to 'goto' without supplying the target; template code where the URL variable failed to resolve.","solutions":["Provide the url: tools.navigate({ action: 'goto', url: 'https://example.com' })","Or omit action entirely (it defaults to 'goto') but always include url","Use action 'reload'/'back'/'forward' when you do not want navigation to a URL"],"exampleFix":"// before\nawait tools.navigate({ action: \"goto\" });\n\n// after\nawait tools.navigate({ action: \"goto\", url: \"https://example.com\" });","handlingStrategy":"validation","validationCode":"if ((input.action ?? \"goto\") === \"goto\" && input.url === undefined) {\n  throw new Error(\"navigate to a URL requires the url field\");\n}","typeGuard":"function canNavigate(i: { action?: string; url?: string }): boolean {\n  const action = i.action ?? \"goto\";\n  return action !== \"goto\" || i.url !== undefined;\n}","tryCatchPattern":null,"preventionTips":["Remember action defaults to 'goto' — supplying url is what makes the call valid","Resolve URL variables before building the tool call","Use back/forward/reload explicitly when no url is intended"],"tags":["eve","input-validation","navigation"],"backgroundTag":null,"analyzedSha":"548b159b30eef119ccf6846c8bc807d0eaa3f6f8","analyzedAt":"2026-08-16T10:12:14.925Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}