Xanathar's Guide to Everything (bless its very name) has official rules for creating improvised traps using thieves' tools.

A character proficient in thieves tools can use them to create a trap using materials they have on hand during a short rest.

They make an ability check using their proficiency in thieves' tools and presumably an ability score the DM deems appropriate. The result of the check determines the DC to spot or disarm the trap.

The damage of the trap is either appropriate to the materials used, or half the check result, as chosen by the DM.