{"record":{"id":"11ff768b5804b696","repo":"vercel-labs/agent-browser","slug":"the-attr-property-requires-an-attribute-name","errorCode":null,"errorMessage":"The \"attr\" property requires an attribute name.","messagePattern":"The \"attr\" property requires an attribute name\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@agent-browser/eve/extension/tools/get.ts","lineNumber":28,"sourceCode":"    \"Read a property of the page or an element: text content, innerHTML, input value, an attribute, the page title or URL, a match count, bounding box, or computed styles.\",\n  inputSchema: z.object({\n    attribute: z.string().optional().describe('Attribute name, required when property is \"attr\".'),\n    property: z.enum([\"text\", \"html\", \"value\", \"attr\", \"title\", \"url\", \"count\", \"box\", \"styles\"]),\n    selector: z\n      .string()\n      .optional()\n      .describe(`Required for element properties. ${SELECTOR_HINT}`),\n  }),\n  async execute({ attribute, property, selector }, ctx) {\n    const args = [\"get\", property];\n    if (!PAGE_PROPERTIES.has(property)) {\n      if (selector === undefined) {\n        throw new Error(`The \"${property}\" property requires a selector.`);\n      }\n      args.push(selector);\n      if (property === \"attr\") {\n        if (attribute === undefined) {\n          throw new Error('The \"attr\" property requires an attribute name.');\n        }\n        args.push(attribute);\n      }\n    }\n    return await runBrowser(ctx, args);\n  },\n});\n","sourceCodeStart":10,"sourceCodeEnd":36,"githubUrl":"https://github.com/vercel-labs/agent-browser/blob/548b159b30eef119ccf6846c8bc807d0eaa3f6f8/packages/@agent-browser/eve/extension/tools/get.ts#L10-L36","documentation":"Within the eve 'get' tool, property 'attr' reads a single attribute, so after the selector check it also requires the attribute name. execute() throws when property is 'attr' and attribute is undefined — the CLI syntax is 'get attr <selector> <attribute>' and there is nothing sensible to send without the name.","triggerScenarios":"Calling get with { property: 'attr', selector: '#link' } while forgetting attribute; assuming attr returns all attributes as a map.","commonSituations":"Models treating attribute as optional metadata; porting code from tools that return full attribute dictionaries.","solutions":["Name the attribute: tools.get({ property: 'attr', selector: '#link', attribute: 'href' })","For element identity/structure use property 'html' instead when you want everything","Validate the attr/attribute pair in your caller before invoking"],"exampleFix":"// before\nawait tools.get({ property: \"attr\", selector: \"#link\" });\n\n// after\nawait tools.get({ property: \"attr\", selector: \"#link\", attribute: \"href\" });","handlingStrategy":"validation","validationCode":"if (input.property === \"attr\") {\n  if (input.attribute === undefined) throw new Error(\"attr requires attribute name\");\n  if (input.selector === undefined) throw new Error(\"attr requires selector\");\n}","typeGuard":"function isAttrRequestValid(i: { property: string; attribute?: string }): boolean {\n  return i.property !== \"attr\" || typeof i.attribute === \"string\";\n}","tryCatchPattern":null,"preventionTips":["Always pair property 'attr' with a named attribute (href, aria-label, data-*)","Use property 'html' when you want the whole element markup instead","Encode the attr/attribute requirement in your tool-call schemas or prompts"],"tags":["eve","input-validation","get-tool","attributes"],"backgroundTag":null,"analyzedSha":"548b159b30eef119ccf6846c8bc807d0eaa3f6f8","analyzedAt":"2026-08-16T10:12:14.925Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}