Building A Type-Safe Tool Framework For Llms In Scala