You can only do it through custom reactions, where the operation is performed by producing materials with poison coatings.
Also, you might want to read this:
(This was after a discussion on pharmacies and dwarves taking drugs with positive and negative effects, where it was mentioned that players might want to script when a dwarf wants to take a medicine with a side-effect that is too dangerous unless necessary.)
Toady, where do you see the ability of players to affect AI behavior? Will we see something that goes more towards having the ability to directly script dwarven AI to use certain items or take certain actions using some logic operations or a rudimentary scripting ability? Or do you see this as being more a matter of dwarves having to somehow learn how and when to properly perform actions or use items from the properties they have in the raws alone? While I'm obviously interested in the effects this can have, I'm also interested in what sort of game design philosophy you have about what level of control you want players to be exerting over their dwarves.
At the extreme end of the potion/material discussion, out beyond what maybe anybody was asking for, I'm absolutely against having to master some sort of scripting language just to get dwarves to poison their weapons. At the same time, it'll be difficult to get dwarves to use certain exotic syndrome-causing materials in a reasonable way that satisfies a player, especially one using potion mods. Maybe it'll end up being usage hints in the raws and classifications in-play for use in the military etc. with some sensible defaults. Ideally they'd be able to handle it like food, water and alcohol (to the extent those aren't broken), and perhaps those would be brought into the same system. For more exotic actions and random weirdness, maybe there are cases in the mods where you'd really want to write some kind of script down, especially for a non-dwarven mod race that does something or other, but that level of support is pretty hard to prioritize when I don't really need or want it for dwarves.
On the other hand, writing from the perspective that every command the player gives will be credited to fortress position holders, if an appropriate official were to order that a liquid, with usage hints/whatever in the raws, will now be used for something entirely outside those bounds (like coating a weapon with syrup), that action might be anything from brilliant to quirky to wasteful to tyrannical to suicidal, depending on the situation. The dwarves aren't currently capable of judging their officials and it's a very difficult problem most of the time. If a randomly-generated creature has a weakness to syrup, maybe coating the weapons with syrup is simply a practical strategy, and in that case syrup wouldn't have the "weapon coating" usage hint in the raws. That coating action is entirely up to player ingenuity, much like ordering the creation of a complicated machine, and it's a reasonable thing to allow.
Manually ordering a dwarf to perform a specific series of actions that can't be presaged in the raws/code might be the only way to save your fort and might be a reasonably orderable action made by some official, but that kind of power can degrade the atmosphere we want to build. It's going to depend on the specific cases, but for the sake of guiding discussion on a wide range of future topics, I think it's best that the player feels that a dwarf's autonomy is being respected. The thing that makes dwarf mode not strictly a hands-off simulation is that you are allowed to compromise dwarves' autonomy if they hold fortress positions, to the extent that you are selecting actions that fall within their position's purview. If an order typically makes it feel like the dwarves are being controlled like marionettes, forced to do things against their will, etc., the order should probably be altered or removed. Presently, there are a ton of things that dwarves don't care about that they should care about, but this is the overall idea.
Poisoning weapons and using medicines is more complicated than you might think.