A$^2$FM: An Adaptive Agent Foundation Model for Tool-Aware Hybrid Reasoning