How can I access the scene tree dock/container/panel through GDScript?

Godot Version

4.6.2

Question

I am currently writing a plugin in GDScript, with a functionality that can only be applied to nodes from the scene tree, like rename/reparent etc.
That’s why I would like its button to spawn in the context menu that comes up when I right click a node in the scene tree dock. But when looking through the docs and online, I didn’t find any clue on how to address that context menu or even just the scene tree dock itself.

Does anybody know the commands for that?

You’ll want to use the EditorContextMenuPlugin.