Speakers of standard English expect the adverbial form first rather than firstly, unless perhaps there is an explicit listing such as “firstly, secondly, thirdly, etc.” And even here there has been some prescriptive opposition to firstly (see under firstly in Merriam Webster’s Dictionary of English Usage). In Jacob 1:17, of course, there is no secondly or thirdly. Jacob is simply saying that initially or earlier he had obtained his errand from the Lord. The Oxford English Dictionary lists ‘before anything else’ as a definition for firstly, which is consistent with the usage here in Jacob 1:17.
Based on the historical development, the English adverb can take either the -ly ending or no ending (historically, the adverbial ending -e). Originally here in Jacob 1:17, the text has firstly, but the 1907 LDS vest-pocket edition made the change to the standard first. This edition was not used as a copy-text. The 1920 LDS edition independently made the same change, and the subsequent LDS text has continued with the standard first. The RLDS text, on the other hand, has maintained the original firstly. For further discussion regarding the variant use of the -ly ending, see under 2 Nephi 25:20 for plain(ly) and under 2 Nephi 33:5 for harsh(ly).
There are two other instances of this nonstandard firstly in the original text, both of which were edited to first in the LDS text early in the 20th century:
The original Book of Mormon text has many examples of the adverb first (16 in all):
The critical text will restore all three original uses of firstly; the earliest textual sources support the standard adverbial form first in 16 cases.
Summary: In accord with the earliest textual sources, maintain the use of the nonstandard firstly in Jacob 1:17, Alma 21:4, and Alma 55:31.