Yes, there is:
Fantastic Machine and Fantastic Machine, Greater
This spell, found in the Spell Compendium, has the following as part of the descriptive text:
This spell creates a bizarre, but useful, machine that you can command to perform any simple, physical task that can be described in twenty-five words or less. You can order the machine to perform the same task over and over, but you can't change the task. You must specify the task when you cast the spell. The machine always acts on your turn in the initiative order. (It can act during the turn you cast the spell.)
However, it has a weight limit, so you may have to... ah... adjust your target to fit.
Note that the Greater version of the spell has a higher weight limit, greater strength, and does more damage.
The spell also appears in the FR setting.
You might use a command phrase like: "Constrain, trap, hold, prevent from escaping, and slowly crush this target over the next hour." The machine would then presumably use it's limbs to execute said actions.