How to use a subgraph as a tool?