ToolForm: Integrate and optimize state population for tools api