Error when copying bone location driver to procedural material property

I’m trying to create a driver by copying the pose location data from a bone (controller) to a procedural material eye location value. When running the script, I get the following error message:

AttributeError: ‘float’ object has no attribute ‘driver_add’

Any thoughts? Am I getting the syntax wrong?

Note the cited error line is highlighted below.

Here is the correct expression that worked:

fcurve = bpy.data.materials[“ToonEyeMat.L”].node_tree.nodes[“Group”].inputs[0].driver_add(‘default_value’, 2)

Note I did not need the “target =” line, so I commented that out.