... the word one is a third person singular pronoun. Notice that even though it is singular, it doesn't need a Determiner. This pronoun one cannot be modified by adjectives and can't be postmodified by preposition phrases.
... the numeral one is functioning as a Determiner in a noun phrase. It's a determinative according to the CaGEL. This word can also not be modified by adjectives:
- *Give me blue one jumper. (ungrammatical)
- Give me the big one at the back
The word one is a bona fide noun. Notice that it can take a range of Determiners such as the, this, that, my. It also has a plural form like other nouns (and when plural can also have Determiners that occur with plural nouns such as many, more, some):
- Give me some big ones from the back.
Notice also that like other nouns it can be modified by adjectives, such as big in the example above. And like other nouns it can be postmodified by preposition phrases. So in the example above we see it modified by the preposition phrase from the back.
The OP's question
There was only one.
In older grammars this one might be regarded as a pronoun. In modern grammars such as the Cambridge Grammar of the English Language (Huddleston & Pullum 2002), this would be regarded as a determinative occurring in a fused Determiner Head construction. It is a bit like the middle example above give me one jumper but with the jumper part missing. In the Original Poster's example it means:
- There was only one [
The Original Poster's sentence is perfectly grammatical. We quite often use the adverb (as opposed to the adjective) only to modify noun phrases:
- It was only [a small bump].
In the Original Poster's example, one counts as a whole noun phrase.