tools: Handle resources properly