def run_agent(input): for event in agent.run(input): # if is tabular df = pd.DataFrame(event.content) **mo.state.register_datasource(df, event.name + event.tool_args + "_df") # <------ saves df to var "nearest_gene_tool_chr15_88569444_df"** mo.output.append(df) ... ...