In general you can run any function you like using the Function Node and keeping the n8n data structure in mind.
I am just not sure I fully understand the task you are facing. Do you want to replace the original item (or possibly multiple items with the same structure) with a single item only having the onlyTags field? Or do you want to add the onlyTags field to your existing item?
That is not possible with a Set-Node (at least not easily, clean and simple). To do that you would have to use a Function-Node with the following code: