Look at BrewingStandMenu.IngredientsSlot or PotionSlot mayPlace() methods with their helpers.
Then look at how BrewingStandMenu uses mayPlace/Item()
Another example would be FurnaceFuelSlot and AbstractFurnaceMenu's use of canSmelt() or isFuel()
The 2 implementations are slightly different.
If you look carefully, canSmelt() is only used in the furnace for shift clicking.
You can in fact manually put anything in the furnace's smelting slot because it just uses a plain Slot and hence has no mayPlace() logic.
So that should give you some idea about what you need to implement to get the behaviour you want.