{"record":{"id":"f5e78259e7022612","repo":"vercel-labs/agent-browser","slug":"the-action-action-requires-a-value","errorCode":null,"errorMessage":"The \"${action}\" action requires a value.","messagePattern":"The \"(.+?)\" action requires a value\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@agent-browser/eve/extension/tools/find.ts","lineNumber":29,"sourceCode":"    by: z.enum([\"role\", \"text\", \"label\", \"placeholder\", \"alt\", \"title\", \"testid\", \"first\", \"last\"]),\n    exact: z\n      .boolean()\n      .default(false)\n      .describe(\n        'Exact, case-sensitive match. For \"role\" it applies to the accessible name, whose default is a case-insensitive substring.',\n      ),\n    name: z\n      .string()\n      .optional()\n      .describe('Accessible name filter when by is \"role\", e.g. role \"button\" named \"Submit\".'),\n    query: z\n      .string()\n      .describe('What to match: the role name, text, label, etc. For \"first\"/\"last\", a CSS selector.'),\n    value: z.string().optional().describe('Text to enter for the \"fill\" action.'),\n  }),\n  async execute({ action, by, exact, name, query, value }, ctx) {\n    if (action === \"fill\" && value === undefined) {\n      throw new Error(`The \"${action}\" action requires a value.`);\n    }\n    const args = [\"find\", by, query, action];\n    if (value !== undefined) args.push(value);\n    if (name !== undefined) args.push(\"--name\", name);\n    if (exact) args.push(\"--exact\");\n    return await runBrowser(ctx, args);\n  },\n});\n","sourceCodeStart":11,"sourceCodeEnd":38,"githubUrl":"https://github.com/vercel-labs/agent-browser/blob/548b159b30eef119ccf6846c8bc807d0eaa3f6f8/packages/@agent-browser/eve/extension/tools/find.ts#L11-L38","documentation":"The eve 'find' tool accepts an action applied to the matched element; the 'fill' action types text, so it requires the optional 'value' field. execute() throws before shelling out to the CLI when action is 'fill' and value is undefined — a cheap input-validation guard so the CLI never receives an incomplete command.","triggerScenarios":"Invoking the find tool with { action: 'fill', by: 'role', query: 'textbox', ... } but omitting value; models leaving optional fields absent because the schema marks value optional.","commonSituations":"LLM agents omitting optional parameters; refactors that drop the value field; form-filling flows where the text lives in a separate variable that is undefined.","solutions":["Pass value: tools.find({ action: 'fill', by: 'role', query: 'textbox', value: 'hello@example.com' })","Default it in your caller when the text may be empty: value: text ?? ''","Validate required action/value pairs before invoking the tool"],"exampleFix":"// before\nawait tools.find({ action: \"fill\", by: \"role\", query: \"textbox\", name: \"Email\" });\n\n// after\nawait tools.find({ action: \"fill\", by: \"role\", query: \"textbox\", name: \"Email\", value: \"user@example.com\" });","handlingStrategy":"validation","validationCode":"if (input.action === \"fill\" && (input.value === undefined || input.value === null)) {\n  throw new Error(\"fill requires the text to type; refusing to call the tool.\");\n}\nawait tools.find(input);","typeGuard":"function isValidFindInput(i: { action: string; value?: string }): boolean {\n  return !(i.action === \"fill\" && i.value === undefined);\n}","tryCatchPattern":null,"preventionTips":["Treat value as required whenever action is fill in your prompting or wrapper types","Default empty strings explicitly (value: text ?? \"\") when the intent is to clear a field","Validate action/value pairs upstream so the tool never sees the bad combination"],"tags":["eve","input-validation","forms","find-tool"],"backgroundTag":null,"analyzedSha":"548b159b30eef119ccf6846c8bc807d0eaa3f6f8","analyzedAt":"2026-08-16T10:12:14.925Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}