Merriam-Webster's definition of "ode" is not very useful for determining whether a specific poem is an ode: the definition is too vague and it ignores the genre's history.
The Oxford Companion to English Literature, edited by Margaret Drabble (revised edition, Oxford University Press, 1995) gives the following definition of "ode":
in ancient literature, a poem intended or adapted to be sung; in modern use, a rhymed (rarely unrhymed) lyric, often in the form of an addres, generally dignified or exalted in subject, feeling, and style, but sometimes (in earlier use) simple and familiar (though less so than a song) [OED].
This is still vague, since it defines a poetic genre that can be rhymed or unrhymed, we learn nothing about its length, structure or metre, and it is not clear what "modern" and "earlier use" refer to.
The Cambridge Guide to Literature in English, edited by Ian Ousby (Cambridge University Press, 1993, 1996) provides the following definition:
A lyric poem in rhymed stanzas, generally in the form of an address and exalted in feeling and expression. Famous examples indlude Keats's "To a Nighthingale" and "On a Grecian Urn" and Wordsworth's "Intimations of Immortallity from Recollections of Early Childhood". The Pindaric ode takes its name from the Greek poet Pindar (522-442 BC) whose work, designed to honour victors in the Greek games, used an elaborate stanzaic pattern of strophe, antistrophe and epode. Abraham Cowley introduced it into English, though he and successors like Dryden and Pope loosened the stanzaic pattern while keeping the poem's public function. Tennyson's "Ode on the Death of the Duke of Wellington" is a fine late example.
About Pindar's "elaborate stanzaic pattern of strophe, antistrophe and epode", The Oxford Companion to English Literature's entry on Pindar tells us:
He used a framework of strophe, antistrophe, and epode which his imitators sought to copy, but in Pindar this framework rested on an elaborate prosodic structure that remained unknown until it was worked out by August Boeckh in his edition of the Odes (1811). The 17th- and 18th-cent. writers of Pindarics–Cowley, Dryden, Pope, Gray–employed a much looser prosodic system, so that their odes, although elevated and rich in metaphor, lacked Pindar's architectural quality.
Abraham Cowley (1618 – 1667) published his Pindarique Odes in 1656. He did not understand the structure and metre of Pindar's Odes; his own "odes" use iambic lines of irregular length and an irregular rhyme scheme (if "scheme" is the right word). See for example the first part of Ode Upon Liberty, where the lines vary between three and five iambs in lenght, and the first four lines don't rhyme at all, followed by lines that rhyme in pairs.
However, the looseness of these so-called pindarics appealed to a number of later poets, including John Dryden (1631 – 1700) and Alexander Pope (1688 – 1744). One of Pope's most frequently anthologised poems is Ode on Solitude, written at the age of 12, which uses an A B A B rhyme scheme for each quatrain; the number of feet in the lines follow the pattern 4, 4, 4, 2. However, the poem is inspired by the Horatian theme beatus ille (happy man); see Horace's Second Epode. This poem was not the first English ode inspired by Horace: Andrew Marvell composed a political address entitled "An Horatian Ode upon Cromwell’s Return from Ireland" in 1650. Other 18th-century odes include "The Day of Judgement: An Ode" by Isaac Watts (1706), "Ode on the Day of Judgement" by Jonathan Swift (circa 1732), "Ode: Rule, Britannia!" by James Thomson (1740), "Ode to Evening" by William Collins (1746) and "The Bard: A Pindaric Ode" by Thomas Gray (1757).
By the time the Romantics started writing odes, its form was already ambiguous: either based on the pindarics (rather than on Pindar's odes) or on Horace. Before Keats wrote his first odes (1815: "Ode to Apollo"), Coleridge had already written "Dejection: An Ode" (first version 1802), and Wordsworth "Ode: Intimations of Immortality from Recollections of Early Childhood" (1807). Especially Wordsworth's "Immortality Ode" has a very irregular line length. (Wikipedia insists on calling it a "Pindaric ode", which is misleading for the reasons mentioned in the paragraph about Cowley, above.) Later, Shelley's "Ode to the West Wind" (1819) would use the terza rima, famous from Dante's Divine Comedy.
What makes "Ode on Melancholy" an ode is that it takes the form of an address ("No, no, go not to Lethe"), its rhymes (although the rhyme scheme is not entirely regular) and its iambic lines. Note that the title uses the preposition "on" instead of "to". Some other Romantic odes, including Keats's own "To Autumn" addresses a personified autumn as if addressing a god/goddess or supernatural being.